eventwaithandle
September 14, 2025 ยท View on GitHub
Shows how to use xtd::threading::event_wait_handle class.
Sources
Build and run
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run
Output
Thread 2 blocks.
Thread 4 blocks.
Thread 0 blocks.
Thread 1 blocks.
Thread 3 blocks.
Press ENTER to release a waiting thread.
Thread 4 exits.
Press ENTER to release a waiting thread.
Thread 2 exits.
Press ENTER to release a waiting thread.
Thread 0 exits.
Press ENTER to release a waiting thread.
Thread 1 exits.
Press ENTER to release a waiting thread.
Thread 3 exits.
Thread 0 blocks.
Thread 1 blocks.
Thread 3 blocks.
Thread 2 blocks.
Thread 4 blocks.
Press ENTER to release the waiting threads.
Thread 2 exits.
Thread 1 exits.
Thread 4 exits.
Thread 3 exits.
Thread 0 exits.