User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

c:thread-pool [2019-05-13 13:40]
ziggi created
c:thread-pool [2019-05-13 13:47]
ziggi
Line 20: Line 20:
     queue++;     queue++;
     pthread_mutex_unlock(&​qmutex);​     pthread_mutex_unlock(&​qmutex);​
 +    pthread_cond_signal(&​cond);​
 } }
 void qpop() { void qpop() {
Line 42: Line 43:
         }         }
         if (qsize() > 0) qpop();         if (qsize() > 0) qpop();
-        pthread_mutex_unlock(&​mutex);​+        ​//pthread_mutex_unlock(&​mutex);​
         printf("​worker %d\n", (int)pthread_self());​         printf("​worker %d\n", (int)pthread_self());​
     }     }