forked from cory/tildefriends
libuv 1.43.0
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3735 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
6
deps/libuv/test/test-thread-equal.c
vendored
6
deps/libuv/test/test-thread-equal.c
vendored
@ -28,6 +28,9 @@ uv_thread_t subthreads[2];
|
||||
static void check_thread(void* arg) {
|
||||
uv_thread_t *thread_id = arg;
|
||||
uv_thread_t self_id = uv_thread_self();
|
||||
#ifdef _WIN32
|
||||
ASSERT_NOT_NULL(self_id);
|
||||
#endif
|
||||
ASSERT(uv_thread_equal(&main_thread_id, &self_id) == 0);
|
||||
*thread_id = uv_thread_self();
|
||||
}
|
||||
@ -35,6 +38,9 @@ static void check_thread(void* arg) {
|
||||
TEST_IMPL(thread_equal) {
|
||||
uv_thread_t threads[2];
|
||||
main_thread_id = uv_thread_self();
|
||||
#ifdef _WIN32
|
||||
ASSERT_NOT_NULL(main_thread_id);
|
||||
#endif
|
||||
ASSERT(0 != uv_thread_equal(&main_thread_id, &main_thread_id));
|
||||
ASSERT(0 == uv_thread_create(threads + 0, check_thread, subthreads + 0));
|
||||
ASSERT(0 == uv_thread_create(threads + 1, check_thread, subthreads + 1));
|
||||
|
Reference in New Issue
Block a user