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