timeout

September 14, 2025 ยท View on GitHub

Shows how to use xtd::threading::timeout class.

Sources

  • src/timeout.cpp
  • CMakeLists.txt

Build and run

Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:

xtdc run

Output

new_thread is executing thread_method.
main thread calls interrupt on new_thread.
new_thread going to sleep.
new_thread cannot go to sleep - interrupted by main thread.

Contents

  1. 1Sources
  2. 2Build and run
  3. 3Output