libuv/docs/code/progress
PRANAV KUMAR 048acb509c
doc: fix threading bugs in progress example (#4956)
Fixed race conditions and memory safety issues in the progress example
by using C11 atomic operations for proper thread synchronization.

Changes:
- Changed percentage from double to _Atomic double
- Use atomic_store_explicit() with memory_order_release when writing
- Use atomic_load_explicit() with memory_order_acquire when reading
- Removed unsafe pointer passing via async.data

This ensures proper memory synchronization between the worker thread
and async callback, preventing data races and dangling pointer issues.

Fixes #4386
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-16 22:36:18 -04:00
..
main.c doc: fix threading bugs in progress example (#4956) 2026-03-16 22:36:18 -04:00