User Tools

Site Tools


Differences

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

Link to this comparison view

Next revision
Previous revision
c:thread-pool [2019-05-13 13:40]
ziggi created
c:thread-pool [2019-05-28 15:26] (current)
Line 5: Line 5:
 /* /*
  *  *
- * Copyright 2019 Oleg Borodin ​ <​borodin@unix7.org>​+ * Copyright ​2004-2019 Oleg Borodin ​ <​borodin@unix7.org>​
  *  *
  */  */
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());​
     }     }