Skip to content

Commit 873ef5c

Browse files
author
Charles PIGNEROL
committed
Pre-release 6.7.0. ThreadPool class fix: reworks.
1 parent 7b8ac69 commit 873ef5c

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

cmake/version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
set (TK_UTIL_MAJOR_VERSION "6")
66
set (TK_UTIL_MINOR_VERSION "7")
7-
set (TK_UTIL_RELEASE_VERSION "0.alpha")
7+
set (TK_UTIL_RELEASE_VERSION "0.beta")
88
set (TK_UTIL_VERSION ${TK_UTIL_MAJOR_VERSION}.${TK_UTIL_MINOR_VERSION}.${TK_UTIL_RELEASE_VERSION})
99

1010
set (TK_UTIL_SCRIPTING_MAJOR_VERSION ${TK_UTIL_MAJOR_VERSION})

src/TkUtil/ThreadPool.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,10 @@ void ThreadPool::addTasks (const vector<ThreadPool::TaskIfc*>& tasks, bool barri
404404

405405
// On réveille les travailleurs s'ils étaient au chômage :
406406
unique_lock<mutex> wakeUpCondLock (_wakeUpCondMutex);
407-
_wakeUpCond.notify_all ( );
407+
if (1 == tasks.size ( ))
408+
_wakeUpCond.notify_one ( ); // v 6.7.0
409+
else
410+
_wakeUpCond.notify_all ( );
408411
} // ThreadPool::addTasks (ThreadIfc* thread)
409412

410413

@@ -546,7 +549,8 @@ void ThreadPool::taskCompleted (ThreadPool::TaskIfc& task)
546549
// On réveille les travailleurs s'ils étaient au chômage. Peut être y a t'il maintenant une tache pouvant être lancée en concurrence avec celles
547550
// actives :
548551
unique_lock<mutex> wakeUpCondLock (_wakeUpCondMutex);
549-
_wakeUpCond.notify_all ( );
552+
// _wakeUpCond.notify_all ( );
553+
_wakeUpCond.notify_one ( ); // v 6.7.0
550554
} // ThreadPool::taskCompleted
551555

552556

versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Version 6.7.0 alpha : 29/01/24
2-
=====================
1+
Version 6.7.0 beta : 30/01/24
2+
====================
33

44
ThreadPool : ne pas mobiliser 100% du CPU en l'absence de tâche
55
- ThreadPool::getTask ( ) non bloquante

0 commit comments

Comments
 (0)