You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eliminate ThreadSanitizer warnings in JIT T2C mode
This fixes data races detected by ThreadSanitizer when running with JIT
compilation enabled:
1. Fix quit flag data race:
- Change 'volatile bool quit' to '_Atomic bool quit'
- Use atomic_store() for writes and atomic_load() for reads
2. Fix TOCTOU race in wait_queue access:
- Move list_empty() check inside mutex-protected critical section
- Hold mutex during entire queue manipulation
These changes ensure thread-safe communication between the main thread
and T2C compilation thread, eliminating all TSAN warning while improving
CPU efficiency by avoiding busy-waiting.
0 commit comments