pithread, pitimer stop, stopAndWait
This commit is contained in:
@@ -114,7 +114,7 @@ PIThreadPoolLoop::PIThreadPoolLoop(int thread_cnt) {
|
||||
|
||||
PIThreadPoolLoop::~PIThreadPoolLoop() {
|
||||
for (auto * t: threads) {
|
||||
t->stop(false);
|
||||
t->stop();
|
||||
if (!t->waitForFinish(100))
|
||||
t->terminate();
|
||||
delete t;
|
||||
@@ -135,7 +135,7 @@ void PIThreadPoolLoop::start(int index_start, int index_count) {
|
||||
while (1) {
|
||||
int cc = counter.fetch_add(1);
|
||||
if (cc >= end) {
|
||||
t->stop(false);
|
||||
t->stop();
|
||||
return;
|
||||
}
|
||||
func(cc);
|
||||
|
||||
Reference in New Issue
Block a user