Merge branch 'master' into cxx17
This commit is contained in:
commit
39500e1fdc
1 changed files with 1 additions and 3 deletions
|
@ -29,8 +29,6 @@ namespace Internal {
|
||||||
template <unsigned int SIZE>
|
template <unsigned int SIZE>
|
||||||
class ThreadPool {
|
class ThreadPool {
|
||||||
public:
|
public:
|
||||||
using THREADCOUNT = std::integral_constant<int, SIZE>;
|
|
||||||
|
|
||||||
ThreadPool() : waitCount(0) {
|
ThreadPool() : waitCount(0) {
|
||||||
isAlive.store(true);
|
isAlive.store(true);
|
||||||
if constexpr(SIZE >= 2) {
|
if constexpr(SIZE >= 2) {
|
||||||
|
@ -160,7 +158,7 @@ public:
|
||||||
bool isAllThreadsWaiting() {
|
bool isAllThreadsWaiting() {
|
||||||
if constexpr(SIZE >= 2) {
|
if constexpr(SIZE >= 2) {
|
||||||
std::lock_guard<std::mutex> lock(waitCountMutex);
|
std::lock_guard<std::mutex> lock(waitCountMutex);
|
||||||
return waitCount == THREADCOUNT::value;
|
return waitCount == SIZE;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue