remove uv_thread_self

This commit is contained in:
Igor Zinkovsky 2012-01-13 17:24:30 -08:00
parent 94a5c7b002
commit 26512731e3
5 changed files with 0 additions and 28 deletions

View File

@ -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 {

View File

@ -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))

View File

@ -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;

View File

@ -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)

View File

@ -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.
*/