Skip to content

fix(Thread): fix Thread reuse error, add thread interrupt feature#4942

Merged
matejk merged 5 commits intopocoproject:mainfrom
siren186:main
Sep 11, 2025
Merged

fix(Thread): fix Thread reuse error, add thread interrupt feature#4942
matejk merged 5 commits intopocoproject:mainfrom
siren186:main

Conversation

@siren186
Copy link
Copy Markdown
Member

  1. fix Thread reuse error
Poco::Thread thread;
thread.start(runnable);
thread.join();

// reuse error
thread.start(runable);
thread.join(); // Error !!!
  1. add thread interrupt feature

See:

Poco demo:

Poco::Thread thread;
thread.interrupt();

// way-1:
bool ret = Poco::Thread::current()->isInterrupted();

// way-2:
Poco::Thread::current()->checkInterrupted(); // throw Poco::ThreadInterruptedException

@matejk matejk added this to the Release 1.15.0 milestone Jul 1, 2025
@siren186 siren186 closed this Aug 21, 2025
@matejk matejk reopened this Aug 21, 2025
@matejk matejk merged commit a31dbe6 into pocoproject:main Sep 11, 2025
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants