Lines Matching refs:ctx
111 CondContext &ctx = *static_cast<CondContext*>(p); in cond_thread() local
113 EXPECT_EQ(__interceptor_pthread_mutex_lock(&ctx.m), 0); in cond_thread()
114 EXPECT_EQ(ctx.data, 0); in cond_thread()
115 ctx.data = 1; in cond_thread()
116 EXPECT_EQ(__interceptor_pthread_cond_signal(&ctx.c), 0); in cond_thread()
117 EXPECT_EQ(__interceptor_pthread_mutex_unlock(&ctx.m), 0); in cond_thread()
119 EXPECT_EQ(__interceptor_pthread_mutex_lock(&ctx.m), 0); in cond_thread()
120 while (ctx.data != 2) in cond_thread()
121 EXPECT_EQ(__interceptor_pthread_cond_wait(&ctx.c, &ctx.m), 0); in cond_thread()
122 EXPECT_EQ(__interceptor_pthread_mutex_unlock(&ctx.m), 0); in cond_thread()
124 EXPECT_EQ(__interceptor_pthread_mutex_lock(&ctx.m), 0); in cond_thread()
125 ctx.data = 3; in cond_thread()
126 EXPECT_EQ(pthread_cond_broadcast(&ctx.c), 0); in cond_thread()
127 EXPECT_EQ(__interceptor_pthread_mutex_unlock(&ctx.m), 0); in cond_thread()
133 CondContext ctx; in TEST() local
134 EXPECT_EQ(__interceptor_pthread_mutex_init(&ctx.m, 0), 0); in TEST()
135 EXPECT_EQ(__interceptor_pthread_cond_init(&ctx.c, 0), 0); in TEST()
136 ctx.data = 0; in TEST()
138 EXPECT_EQ(__interceptor_pthread_create(&th, 0, cond_thread, &ctx), 0); in TEST()
140 EXPECT_EQ(__interceptor_pthread_mutex_lock(&ctx.m), 0); in TEST()
141 while (ctx.data != 1) in TEST()
142 EXPECT_EQ(__interceptor_pthread_cond_wait(&ctx.c, &ctx.m), 0); in TEST()
143 ctx.data = 2; in TEST()
144 EXPECT_EQ(__interceptor_pthread_mutex_unlock(&ctx.m), 0); in TEST()
145 EXPECT_EQ(pthread_cond_broadcast(&ctx.c), 0); in TEST()
147 EXPECT_EQ(__interceptor_pthread_mutex_lock(&ctx.m), 0); in TEST()
148 while (ctx.data != 3) in TEST()
149 EXPECT_EQ(__interceptor_pthread_cond_wait(&ctx.c, &ctx.m), 0); in TEST()
150 EXPECT_EQ(__interceptor_pthread_mutex_unlock(&ctx.m), 0); in TEST()
153 EXPECT_EQ(__interceptor_pthread_cond_destroy(&ctx.c), 0); in TEST()
154 EXPECT_EQ(__interceptor_pthread_mutex_destroy(&ctx.m), 0); in TEST()