Lines Matching refs:wc
52 worker_config wc; in TEST_IMPL() local
54 memset(&wc, 0, sizeof(wc)); in TEST_IMPL()
56 ASSERT_OK(uv_sem_init(&wc.sem, 0)); in TEST_IMPL()
57 ASSERT_OK(uv_mutex_init(&wc.mutex)); in TEST_IMPL()
58 ASSERT_OK(uv_thread_create(&thread, worker, &wc)); in TEST_IMPL()
61 uv_mutex_lock(&wc.mutex); in TEST_IMPL()
62 ASSERT_EQ(1, wc.posted); in TEST_IMPL()
63 uv_sem_wait(&wc.sem); /* should not block */ in TEST_IMPL()
64 uv_mutex_unlock(&wc.mutex); /* ergo, it should be ok to unlock after wait */ in TEST_IMPL()
67 uv_mutex_destroy(&wc.mutex); in TEST_IMPL()
68 uv_sem_destroy(&wc.sem); in TEST_IMPL()
76 worker_config wc; in TEST_IMPL() local
78 memset(&wc, 0, sizeof(wc)); in TEST_IMPL()
79 wc.delay = 100; in TEST_IMPL()
81 ASSERT_OK(uv_sem_init(&wc.sem, 0)); in TEST_IMPL()
82 ASSERT_OK(uv_mutex_init(&wc.mutex)); in TEST_IMPL()
83 ASSERT_OK(uv_thread_create(&thread, worker, &wc)); in TEST_IMPL()
85 uv_sem_wait(&wc.sem); in TEST_IMPL()
88 uv_mutex_destroy(&wc.mutex); in TEST_IMPL()
89 uv_sem_destroy(&wc.sem); in TEST_IMPL()