Add uv_thread_self.
This commit is contained in:
parent
2b04bc7a74
commit
1f9bd99531
@ -1789,6 +1789,7 @@ UV_EXTERN void uv_once(uv_once_t* guard, void (*callback)(void));
|
||||
|
||||
UV_EXTERN int uv_thread_create(uv_thread_t *tid,
|
||||
void (*entry)(void *arg), void *arg);
|
||||
UV_EXTERN unsigned long uv_thread_self(void);
|
||||
UV_EXTERN int uv_thread_join(uv_thread_t *tid);
|
||||
|
||||
/* the presence of these unions force similar struct layout */
|
||||
|
||||
@ -314,6 +314,15 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) {
|
||||
}
|
||||
|
||||
|
||||
unsigned long uv_thread_self(void) {
|
||||
#ifdef _WIN32
|
||||
return (unsigned long) GetCurrentThreadId();
|
||||
#else
|
||||
return (unsigned long) pthread_self();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg) {
|
||||
ngx_queue_t* q;
|
||||
uv_handle_t* h;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user