diff options
Diffstat (limited to 'ot_event.c')
| -rw-r--r-- | ot_event.c | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -40,6 +40,9 @@ static struct epoll_event *g_ready; | |||
| 40 | static int g_ready_space; | 40 | static int g_ready_space; |
| 41 | 41 | ||
| 42 | const char *event_mechanism(void) { return "epoll"; } | 42 | const char *event_mechanism(void) { return "epoll"; } |
| 43 | /* The set lives in the kernel, and epoll_ctl during another thread's | ||
| 44 | epoll_wait is what it is for */ | ||
| 45 | int event_can_share(void) { return 1; } | ||
| 43 | 46 | ||
| 44 | int event_init(void) { | 47 | int event_init(void) { |
| 45 | g_ready = NULL; | 48 | g_ready = NULL; |
| @@ -118,6 +121,8 @@ static struct kevent *g_ready; | |||
| 118 | static int g_ready_space; | 121 | static int g_ready_space; |
| 119 | 122 | ||
| 120 | const char *event_mechanism(void) { return "kqueue"; } | 123 | const char *event_mechanism(void) { return "kqueue"; } |
| 124 | /* The set lives in the kernel, and kevent may be called from any thread */ | ||
| 125 | int event_can_share(void) { return 1; } | ||
| 121 | 126 | ||
| 122 | int event_init(void) { | 127 | int event_init(void) { |
| 123 | g_ready = NULL; | 128 | g_ready = NULL; |
| @@ -229,6 +234,8 @@ static int *g_where; | |||
| 229 | static int g_count, g_space, g_where_space; | 234 | static int g_count, g_space, g_where_space; |
| 230 | 235 | ||
| 231 | const char *event_mechanism(void) { return "poll"; } | 236 | const char *event_mechanism(void) { return "poll"; } |
| 237 | /* The arrays below are ours and nothing guards them */ | ||
| 238 | int event_can_share(void) { return 0; } | ||
| 232 | 239 | ||
| 233 | int event_init(void) { | 240 | int event_init(void) { |
| 234 | g_pfds = NULL, g_generation = NULL, g_where = NULL; | 241 | g_pfds = NULL, g_generation = NULL, g_where = NULL; |
