blob: 2da54d2516df03faab6e0fbcaedfab950ed062f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/**** POSIX *******************************************************************/
#include <pthread.h>
#include <string.h>
/**** RELABSD *****************************************************************/
#include <relabsd/debug.h>
/******************************************************************************/
/**** LOCAL FUNCTIONS *********************************************************/
/******************************************************************************/
void main_loop (struct relabsd_server server [const static 1])
{
}
void * posix_main_loop (void * params)
{
main_loop((struct relabsd_server *) params);
return NULL;
}
/******************************************************************************/
/**** EXPORTED FUNCTIONS ******************************************************/
/******************************************************************************/
int relabsd_server_create_communication_thread
(
struct relabsd_server server [const static 1]
)
{
int err;
err =
pthread_create
(
&(server->communication_thread),
(const pthread_attr_t *) NULL,
posix_main_loop,
(void *) server
);
if (err != 0)
{
RELABSD_FATAL
(
"Unable to create the communication thread: %s",
strerror(err)
);
return -1;
}
return 0;
}
|