Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
uv: revert change causing build failures
Browse files Browse the repository at this point in the history
Revert uv_thread_self() to return unsigned long instead of uv_thread_t.
This was causing a build failure on Windows and is only a temporary fix
until the proper patch lands upstream.

Reverts: joyent/libuv@59658a8
Fixes: ce112c2 "deps: update uv to v1.0.0-rc2"
  • Loading branch information
trevnorris committed Nov 7, 2014
1 parent e46cbaa commit 5845a6b
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 65 deletions.
1 change: 0 additions & 1 deletion deps/uv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-tcp-writealot.c \
test/test-tcp-try-write.c \
test/test-tcp-write-queue-order.c \
test/test-thread-equal.c \
test/test-thread.c \
test/test-threadpool-cancel.c \
test/test-threadpool.c \
Expand Down
1 change: 0 additions & 1 deletion deps/uv/docs/src/threading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Threads
.. c:function:: int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg)
.. c:function:: unsigned long uv_thread_self(void)
.. c:function:: int uv_thread_join(uv_thread_t *tid)
.. c:function:: int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2)
Thread-local storage
^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions deps/uv/include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1369,9 +1369,8 @@ UV_EXTERN void uv_key_set(uv_key_t* key, void* value);
typedef void (*uv_thread_cb)(void* arg);

UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg);
UV_EXTERN uv_thread_t uv_thread_self(void);
UV_EXTERN unsigned long uv_thread_self(void);
UV_EXTERN int uv_thread_join(uv_thread_t *tid);
UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2);

/* The presence of these unions force similar struct layout. */
#define XX(_, name) uv_ ## name ## _t name;
Expand Down
5 changes: 0 additions & 5 deletions deps/uv/src/unix/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ int uv_thread_join(uv_thread_t *tid) {
}


int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2) {
return pthread_equal(*t1, *t2);
}


int uv_mutex_init(uv_mutex_t* mutex) {
#if defined(NDEBUG) || !defined(PTHREAD_MUTEX_ERRORCHECK)
return -pthread_mutex_init(mutex, NULL);
Expand Down
6 changes: 3 additions & 3 deletions deps/uv/src/uv-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) {
}


uv_thread_t uv_thread_self(void) {
unsigned long uv_thread_self(void) {
#ifdef _WIN32
return GetCurrentThreadId();
return (unsigned long) GetCurrentThreadId();
#else
return pthread_self();
return (unsigned long) pthread_self();
#endif
}

Expand Down
5 changes: 0 additions & 5 deletions deps/uv/src/win/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ int uv_thread_join(uv_thread_t *tid) {
}


int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2) {
return *t1 == *t2;
}


int uv_mutex_init(uv_mutex_t* mutex) {
InitializeCriticalSection(mutex);
return 0;
Expand Down
2 changes: 0 additions & 2 deletions deps/uv/test/test-list.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ TEST_DECLARE (thread_local_storage)
TEST_DECLARE (thread_mutex)
TEST_DECLARE (thread_rwlock)
TEST_DECLARE (thread_create)
TEST_DECLARE (thread_equal)
TEST_DECLARE (dlerror)
TEST_DECLARE (poll_duplex)
TEST_DECLARE (poll_unidirectional)
Expand Down Expand Up @@ -633,7 +632,6 @@ TASK_LIST_START
TEST_ENTRY (thread_mutex)
TEST_ENTRY (thread_rwlock)
TEST_ENTRY (thread_create)
TEST_ENTRY (thread_equal)
TEST_ENTRY (dlerror)
TEST_ENTRY (ip4_addr)
TEST_ENTRY (ip6_addr_link_local)
Expand Down
45 changes: 0 additions & 45 deletions deps/uv/test/test-thread-equal.c

This file was deleted.

1 change: 0 additions & 1 deletion deps/uv/uv.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@
'test/test-tcp-write-queue-order.c',
'test/test-threadpool.c',
'test/test-threadpool-cancel.c',
'test/test-thread-equal.c',
'test/test-mutexes.c',
'test/test-thread.c',
'test/test-barrier.c',
Expand Down

0 comments on commit 5845a6b

Please sign in to comment.