libIEC61850
Open-source IEC 61850 MMS server and client library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
thread.h
Go to the documentation of this file.
1 /*
2  * thread.h
3  *
4  * Multi-threading abstraction layer
5  *
6  * Copyright 2013 Michael Zillgith
7  *
8  * This file is part of libIEC61850.
9  *
10  * libIEC61850 is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * libIEC61850 is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * See COPYING file for the complete license text.
24  */
25 
26 #ifndef THREAD_H_
27 #define THREAD_H_
28 
29 #include <stdbool.h>
30 
37 typedef struct sThread* Thread;
38 
40 typedef void* (*ThreadExecutionFunction) (void*);
41 
51 Thread
52 Thread_create(ThreadExecutionFunction function, void* parameter, bool autodestroy);
53 
62 void
63 Thread_start(Thread thread);
64 
70 void
71 Thread_destroy(Thread thread);
72 
76 void
77 Thread_sleep(int millies);
78 
81 #endif /* THREAD_H_ */