Lines Matching refs:ctx
3749 const struct thread_ctx* ctx; in thread_main() local
3753 ctx = (struct thread_ctx*)arg; in thread_main()
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()
3762 result = write(ctx->fd, data, nbytes); in thread_main()
3766 result = read(ctx->fd, data, nbytes); in thread_main()
3773 pthread_kill(ctx->pid, SIGUSR1); 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()
3815 ctx.size = sizeof(test_buf) * iovcount; in test_fs_partial()
3816 ctx.data = calloc(ctx.size, 1); in test_fs_partial()
3817 ASSERT_NOT_NULL(ctx.data); in test_fs_partial()
3818 buffer = calloc(ctx.size, 1); in test_fs_partial()
3831 ctx.fd = pipe_fds[doread]; in test_fs_partial()
3832 ASSERT_OK(uv_thread_create(&thread, thread_main, &ctx)); in test_fs_partial()
3839 while (nread < ctx.size) { in test_fs_partial()
3857 ASSERT_EQ(result, ctx.size); in test_fs_partial()
3863 ASSERT_MEM_EQ(buffer, ctx.data, ctx.size); in test_fs_partial()
3880 free(ctx.data); in test_fs_partial()