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 #ifndef BASE_SYSTHR_H
35 #define BASE_SYSTHR_H
36
37 #ifndef NOINTNSAPI
38 #define INTNSAPI
39 #endif
40
41
42
43
44
45
46
47 #ifndef NETSITE_H
48 #include "../daemon/netsite.h"
49 #include "../public/nsapi.h"
50
51 #endif
52
53 #define THREAD_ANY
54 #ifdef THREAD_ANY
55
56
57
58 #define INTNSAPI
59 #ifdef INTNSAPI
60
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64
65 typedef void* (*posix_thrstartfunc)(
void *);
66
67 NSAPI_PUBLIC
68 SYS_THREAD INTsysthread_start(
int prio,
int stksz, thrstartfunc fn,
void *arg);
69
70 NSAPI_PUBLIC SYS_THREAD INTsysthread_current(
void);
71
72 NSAPI_PUBLIC void INTsysthread_yield(
void);
73
74 NSAPI_PUBLIC SYS_THREAD INTsysthread_attach(
void);
75
76 NSAPI_PUBLIC void INTsysthread_detach(
SYS_THREAD thr);
77
78 NSAPI_PUBLIC void INTsysthread_terminate(
SYS_THREAD thr);
79
80 NSAPI_PUBLIC void INTsysthread_sleep(
int msec);
81
82 NSAPI_PUBLIC void INTsysthread_init(
char *name);
83
84 NSAPI_PUBLIC void INTsysthread_timerset(
int usec);
85
86 NSAPI_PUBLIC int INTsysthread_newkey(
void);
87
88 NSAPI_PUBLIC void *INTsysthread_getdata(
int key);
89
90 NSAPI_PUBLIC void INTsysthread_setdata(
int key,
void *data);
91
92 NSAPI_PUBLIC
93 void INTsysthread_set_default_stacksize(
unsigned long size);
94
95 #ifdef __cplusplus
96 }
97 #endif
98
99
100
101 #define systhread_start INTsysthread_start
102 #define systhread_current INTsysthread_current
103 #define systhread_yield INTsysthread_yield
104 #define systhread_attach INTsysthread_attach
105 #define systhread_detach INTsysthread_detach
106 #define systhread_terminate INTsysthread_terminate
107 #define systhread_sleep INTsysthread_sleep
108 #define systhread_init INTsysthread_init
109 #define systhread_timerset INTsysthread_timerset
110 #define systhread_newkey INTsysthread_newkey
111 #define systhread_getdata INTsysthread_getdata
112 #define systhread_setdata INTsysthread_setdata
113 #define systhread_set_default_stacksize INTsysthread_set_default_stacksize
114
115 #endif
116
117 #endif
118
119 #endif
120