Mercurial
view third_party/libuv/docs/code/thread-create/main.c @ 260:1f9877b637e9
Add Copilot-powered cyberpunk JRPG chat
Integrate the production JRPG chat with Seobeo streaming, Deita persistence, and a Bazel-managed Copilot SDK and LiteLLM inference stack.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <mrjunejune@users.noreply.github.com> |
|---|---|
| date | Wed, 05 Aug 2026 09:19:41 -0700 |
| parents | 948de3f54cea |
| children |
line wrap: on
line source
#include <stdio.h> #include <uv.h> void hare(void *arg) { int tracklen = *((int *) arg); while (tracklen) { tracklen--; uv_sleep(1000); fprintf(stderr, "Hare ran another step\n"); } fprintf(stderr, "Hare done running!\n"); } void tortoise(void *arg) { int tracklen = *((int *) arg); while (tracklen) { tracklen--; fprintf(stderr, "Tortoise ran another step\n"); uv_sleep(3000); } fprintf(stderr, "Tortoise done running!\n"); } int main() { int tracklen = 10; uv_thread_t hare_id; uv_thread_t tortoise_id; uv_thread_create(&hare_id, hare, &tracklen); uv_thread_create(&tortoise_id, tortoise, &tracklen); uv_thread_join(&hare_id); uv_thread_join(&tortoise_id); return 0; }