diff --git a/include/uv.h b/include/uv.h index 3f6df256..96341127 100644 --- a/include/uv.h +++ b/include/uv.h @@ -1349,7 +1349,6 @@ 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 int uv_thread_join(uv_thread_t *tid); -UV_EXTERN uv_thread_t uv_thread_self(void); /* the presence of these unions force similar struct layout */ union uv_any_handle { diff --git a/src/unix/thread.c b/src/unix/thread.c index 9a6b3d1b..4a987a71 100644 --- a/src/unix/thread.c +++ b/src/unix/thread.c @@ -47,10 +47,6 @@ int uv_thread_join(uv_thread_t *tid) { return 0; } -uv_thread_t uv_thread_self(void) { - return pthread_self(); -} - int uv_mutex_init(uv_mutex_t* mutex) { if (pthread_mutex_init(mutex, NULL)) diff --git a/src/win/thread.c b/src/win/thread.c index 2d13d520..d6d3ce8f 100644 --- a/src/win/thread.c +++ b/src/win/thread.c @@ -113,11 +113,6 @@ int uv_thread_join(uv_thread_t *tid) { } -uv_thread_t uv_thread_self(void) { - return GetCurrentThread(); -} - - int uv_mutex_init(uv_mutex_t* mutex) { InitializeCriticalSection(mutex); return 0; diff --git a/test/test-list.h b/test/test-list.h index 4fcc055e..6d09ba48 100644 --- a/test/test-list.h +++ b/test/test-list.h @@ -125,7 +125,6 @@ TEST_DECLARE (threadpool_multiple_event_loops) TEST_DECLARE (thread_mutex) TEST_DECLARE (thread_rwlock) TEST_DECLARE (thread_create) -TEST_DECLARE (thread_self) TEST_DECLARE (strlcpy) TEST_DECLARE (strlcat) TEST_DECLARE (counters_init) @@ -294,7 +293,6 @@ TASK_LIST_START TEST_ENTRY (thread_mutex) TEST_ENTRY (thread_rwlock) TEST_ENTRY (thread_create) - TEST_ENTRY (thread_self) TEST_ENTRY (strlcpy) TEST_ENTRY (strlcat) TEST_ENTRY (counters_init) diff --git a/test/test-thread.c b/test/test-thread.c index 5c0bb75e..fcdff7c1 100644 --- a/test/test-thread.c +++ b/test/test-thread.c @@ -59,8 +59,6 @@ static volatile int thread_called; static void getaddrinfo_do(struct getaddrinfo_req* req) { int r; - ASSERT(req->thread_id == uv_thread_self()); - r = uv_getaddrinfo(req->loop, &req->handle, getaddrinfo_cb, @@ -89,8 +87,6 @@ static void getaddrinfo_cb(uv_getaddrinfo_t* handle, static void fs_do(struct fs_req* req) { int r; - ASSERT(req->thread_id == uv_thread_self()); - r = uv_fs_stat(req->loop, &req->handle, ".", fs_cb); ASSERT(r == 0); } @@ -107,19 +103,15 @@ static void fs_cb(uv_fs_t* handle) { static void do_work(void* arg) { struct getaddrinfo_req getaddrinfo_reqs[16]; struct fs_req fs_reqs[16]; - uv_thread_t self; uv_loop_t* loop; size_t i; int r; - self = uv_thread_self(); - loop = uv_loop_new(); ASSERT(loop != NULL); for (i = 0; i < ARRAY_SIZE(getaddrinfo_reqs); i++) { struct getaddrinfo_req* req = getaddrinfo_reqs + i; - req->thread_id = self; req->counter = 16; req->loop = loop; getaddrinfo_do(req); @@ -127,7 +119,6 @@ static void do_work(void* arg) { for (i = 0; i < ARRAY_SIZE(fs_reqs); i++) { struct fs_req* req = fs_reqs + i; - req->thread_id = self; req->counter = 16; req->loop = loop; fs_do(req); @@ -162,13 +153,6 @@ TEST_IMPL(thread_create) { } -TEST_IMPL(thread_self) { - uv_thread_t tid; - tid = uv_thread_self(); - return 0; -} - - /* Hilariously bad test name. Run a lot of tasks in the thread pool and verify * that each "finished" callback is run in its originating thread. */