/libuv/test/ |
H A D | benchmark-async.c | 30 struct ctx { struct 44 struct ctx* ctx = container_of(handle, struct ctx, worker_async); in worker_async_cb() local 47 ctx->worker_sent++; in worker_async_cb() 48 ctx->worker_seen++; in worker_async_cb() 56 struct ctx* ctx = container_of(handle, struct ctx, main_async); in main_async_cb() local 59 ctx->main_sent++; in main_async_cb() 60 ctx->main_seen++; in main_async_cb() 68 struct ctx* ctx = arg; in worker() local 77 struct ctx* threads; in test_async() 78 struct ctx* ctx; in test_async() local [all …]
|
H A D | benchmark-multi-accept.c | 140 struct ipc_peer_ctx* ctx; in ipc_write_cb() local 147 struct ipc_peer_ctx* ctx; in ipc_close_cb() local 149 free(ctx); in ipc_close_cb() 168 buf->base = ctx->scratch; in ipc_alloc_cb() 258 struct server_ctx *ctx; in server_cb() local 261 ctx = arg; in server_cb() 283 struct server_ctx* ctx; in sv_async_cb() local 292 struct server_ctx* ctx; in sv_connection_cb() local 309 ctx->num_connects++; in sv_connection_cb() 345 struct client_ctx* ctx; in cl_close_cb() local [all …]
|
H A D | test-ipc-send-recv.c | 65 static struct test_ctx ctx; variable 99 ASSERT_PTR_EQ(pipe, &ctx.channel); in recv_cb() 103 recv = &ctx.recv; in recv_cb() 105 recv = &ctx.recv2; in recv_cb() 150 r = uv_write2(&ctx.write_req, in connect_cb() 153 &ctx.send.stream, in connect_cb() 161 r = uv_write2(&ctx.write_req2, in connect_cb() 164 &ctx.send2.stream, in connect_cb() 186 uv_pipe_connect(&ctx.connect_req, &ctx.channel, TEST_PIPENAME_3, connect_cb); in run_test() 190 connect_cb(&ctx.connect_req, 0); in run_test() [all …]
|
H A D | test-signal.c | 103 ASSERT_EQ(signum, ctx->signum); in signal_cb() 116 ASSERT_EQ(signum, ctx->signum); in signal_cb_one_shot() 117 ASSERT_EQ(1, ++ctx->ncalls); in signal_cb_one_shot() 126 raise(ctx->signum); in timer_cb() 128 if (++ctx->ncalls == NSIGNALS) in timer_cb() 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() 149 ctx->ncalls = 0; in start_timer() [all …]
|
H A D | test-pipe-set-non-blocking.c | 30 struct thread_ctx* ctx; in thread_main() local 39 ctx = arg; in thread_main() 40 uv_barrier_wait(&ctx->barrier); in thread_main() 44 uv_errno = uv_fs_read(NULL, &req, ctx->fd, bufs, 1, -1, NULL); in thread_main() 68 struct thread_ctx ctx; in TEST_IMPL() local 86 ctx.fd = fd[0]; in TEST_IMPL() 87 ASSERT_OK(uv_barrier_init(&ctx.barrier, 2)); in TEST_IMPL() 88 ASSERT_OK(uv_thread_create(&thread, thread_main, &ctx)); in TEST_IMPL() 89 uv_barrier_wait(&ctx.barrier); in TEST_IMPL() 127 uv_barrier_destroy(&ctx.barrier); in TEST_IMPL()
|
H A D | test-eintr-handling.c | 65 struct thread_ctx ctx; in TEST_IMPL() local 77 ASSERT_OK(uv_thread_create(&thread, thread_main, &ctx)); in TEST_IMPL()
|
H A D | test-fs.c | 3754 size = ctx->size; in thread_main() 3755 data = ctx->data; in thread_main() 3760 nbytes = size < ctx->interval ? size : ctx->interval; in thread_main() 3761 if (ctx->doread) { in thread_main() 3798 struct thread_ctx ctx; in test_fs_partial() local 3812 ctx.pid = pthread_self(); in test_fs_partial() 3813 ctx.doread = doread; in test_fs_partial() 3814 ctx.interval = 1000; in test_fs_partial() 3816 ctx.data = calloc(ctx.size, 1); in test_fs_partial() 3863 ASSERT_MEM_EQ(buffer, ctx.data, ctx.size); in test_fs_partial() [all …]
|
/libuv/src/ |
H A D | fs-poll.c | 80 ctx = uv__calloc(1, sizeof(*ctx) + len); in uv_fs_poll_start() 82 if (ctx == NULL) in uv_fs_poll_start() 99 err = uv_fs_stat(loop, &ctx->fs_req, ctx->path, poll_cb); in uv_fs_poll_start() 111 uv__free(ctx); in uv_fs_poll_start() 177 assert(ctx->parent_handle->poll_ctx == ctx); in timer_cb() 178 ctx->start_time = uv_now(ctx->loop); in timer_cb() 180 if (uv_fs_stat(ctx->loop, &ctx->fs_req, ctx->path, poll_cb)) in timer_cb() 199 ctx->poll_cb(ctx->parent_handle, in poll_cb() 212 ctx->poll_cb(ctx->parent_handle, 0, &ctx->statbuf, statbuf); in poll_cb() 227 interval -= (uv_now(ctx->loop) - ctx->start_time) % interval; in poll_cb() [all …]
|
/libuv/src/win/ |
H A D | thread.c | 77 struct thread_ctx ctx; in uv__thread_start() local 80 ctx = *ctx_p; in uv__thread_start() 86 ctx.entry(ctx.arg); in uv__thread_start() 102 struct thread_ctx* ctx; in uv_thread_create_ex() local 122 ctx = uv__malloc(sizeof(*ctx)); in uv_thread_create_ex() 123 if (ctx == NULL) in uv_thread_create_ex() 126 ctx->entry = entry; in uv_thread_create_ex() 127 ctx->arg = arg; in uv_thread_create_ex() 134 ctx, in uv_thread_create_ex() 139 uv__free(ctx); in uv_thread_create_ex() [all …]
|
/libuv/src/unix/ |
H A D | fsevents.c | 331 FSEventStreamContext ctx; in uv__fsevents_create_stream() local 337 memset(&ctx, 0, sizeof(ctx)); in uv__fsevents_create_stream() 338 ctx.info = loop; in uv__fsevents_create_stream() 364 &ctx, in uv__fsevents_create_stream() 581 CFRunLoopSourceContext ctx; in uv__fsevents_loop_init() local 619 memset(&ctx, 0, sizeof(ctx)); in uv__fsevents_loop_init() 620 ctx.info = loop; in uv__fsevents_loop_init() 621 ctx.perform = uv__cf_loop_cb; in uv__fsevents_loop_init() 622 state->signal_source = pCFRunLoopSourceCreate(NULL, 0, &ctx); in uv__fsevents_loop_init()
|