We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 35e19bb commit 3790e4eCopy full SHA for 3790e4e
1 file changed
threadpool.cpp
@@ -102,7 +102,10 @@ ThreadPool::~ThreadPool()
102
int ret = 0;
103
// make sure all thread finish its jobs.
104
for (unsigned int i = 0; i < _thread_pool.size(); ++i) {
105
- ret = sem_timedwait(&_available_work, &DESTROY_TIMEOUT);
+ do {
106
+ ret = sem_timedwait(&_available_work, &DESTROY_TIMEOUT);
107
+ } while (0 != ret && EINTR == errno);
108
+
109
if (0 != ret) {
110
std::cerr << "Timeout, stop ThreadPool" << std::endl;
111
break;
0 commit comments