Diffstat (limited to 'qmake/tools/qwaitcondition_unix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | qmake/tools/qwaitcondition_unix.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/qmake/tools/qwaitcondition_unix.cpp b/qmake/tools/qwaitcondition_unix.cpp index 99c1014..6684617 100644 --- a/qmake/tools/qwaitcondition_unix.cpp +++ b/qmake/tools/qwaitcondition_unix.cpp | |||
@@ -126,3 +126,3 @@ struct QWaitConditionPrivate { | |||
126 | // Sleep until there are no busy worker threads | 126 | // Sleep until there are no busy worker threads |
127 | while( count > 0 ) { | 127 | while( mycount > 0 ) { |
128 | mymutex.unlock(); | 128 | mymutex.unlock(); |
@@ -226,3 +226,5 @@ bool QWaitCondition::wait(unsigned long time) | |||
226 | { | 226 | { |
227 | pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; | 227 | pthread_mutex_t mutex; |
228 | pthread_mutex_init( &mutex, 0 ); | ||
229 | pthread_mutex_lock( &mutex ); | ||
228 | 230 | ||
@@ -234,3 +236,3 @@ bool QWaitCondition::wait(unsigned long time) | |||
234 | timespec ti; | 236 | timespec ti; |
235 | ti.tv_nsec = (tv.tv_usec * 1000) + (time % 1000) * 1000; | 237 | ti.tv_nsec = ( tv.tv_usec + ( time % 1000 ) * 1000 ) * 1000; |
236 | ti.tv_sec = tv.tv_sec + (time / 1000) + ( ti.tv_nsec / 1000000000 ); | 238 | ti.tv_sec = tv.tv_sec + (time / 1000) + ( ti.tv_nsec / 1000000000 ); |
@@ -247,2 +249,5 @@ bool QWaitCondition::wait(unsigned long time) | |||
247 | 249 | ||
250 | pthread_mutex_unlock( &mutex ); | ||
251 | pthread_mutex_destroy( &mutex ); | ||
252 | |||
248 | return (ret == 0); | 253 | return (ret == 0); |
@@ -293,3 +298,3 @@ bool QWaitCondition::wait(QMutex *mutex, unsigned long time) | |||
293 | timespec ti; | 298 | timespec ti; |
294 | ti.tv_nsec = (tv.tv_usec * 1000) + (time % 1000) * 1000; | 299 | ti.tv_nsec = ( tv.tv_usec + ( time % 1000 ) * 1000 ) * 1000; |
295 | ti.tv_sec = tv.tv_sec + (time / 1000) + ( ti.tv_nsec / 1000000000 ); | 300 | ti.tv_sec = tv.tv_sec + (time / 1000) + ( ti.tv_nsec / 1000000000 ); |