Lines Matching refs:ctx
102 struct signal_ctx* ctx = container_of(handle, struct signal_ctx, handle); in signal_cb() local
103 ASSERT_EQ(signum, ctx->signum); in signal_cb()
104 if (++ctx->ncalls == NSIGNALS) { in signal_cb()
105 if (ctx->stop_or_close == STOP) in signal_cb()
107 else if (ctx->stop_or_close == CLOSE) in signal_cb()
115 struct signal_ctx* ctx = container_of(handle, struct signal_ctx, handle); in signal_cb_one_shot() local
116 ASSERT_EQ(signum, ctx->signum); in signal_cb_one_shot()
117 ASSERT_EQ(1, ++ctx->ncalls); in signal_cb_one_shot()
118 if (ctx->stop_or_close == CLOSE) in signal_cb_one_shot()
124 struct timer_ctx* ctx = container_of(handle, struct timer_ctx, handle); in timer_cb() local
126 raise(ctx->signum); in timer_cb()
128 if (++ctx->ncalls == NSIGNALS) in timer_cb()
135 struct signal_ctx* ctx, in start_watcher() argument
137 ctx->ncalls = 0; in start_watcher()
138 ctx->signum = signum; in start_watcher()
139 ctx->stop_or_close = CLOSE; in start_watcher()
140 ctx->one_shot = one_shot; in start_watcher()
141 ASSERT_OK(uv_signal_init(loop, &ctx->handle)); in start_watcher()
143 ASSERT_OK(uv_signal_start_oneshot(&ctx->handle, signal_cb_one_shot, signum)); in start_watcher()
145 ASSERT_OK(uv_signal_start(&ctx->handle, signal_cb, signum)); in start_watcher()
148 static void start_timer(uv_loop_t* loop, int signum, struct timer_ctx* ctx) { in start_timer() argument
149 ctx->ncalls = 0; in start_timer()
150 ctx->signum = signum; in start_timer()
151 ASSERT_OK(uv_timer_init(loop, &ctx->handle)); in start_timer()
152 ASSERT_OK(uv_timer_start(&ctx->handle, timer_cb, 5, 5)); in start_timer()