# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1299785807 0 # Node ID 3b17111499bf8e537aec97e830c80f6ec1a7784a # Parent 130ca42c4ae32158f6cf99ed4224d21bbdb084a8 Minor updates to the last commit. diff -r 130ca42c4ae3 -r 3b17111499bf mac/dw.m --- a/mac/dw.m Thu Mar 10 18:58:05 2011 +0000 +++ b/mac/dw.m Thu Mar 10 19:36:47 2011 +0000 @@ -1718,18 +1718,18 @@ gettimeofday(&tv, NULL); dw_mutex_lock(DWRunMutex); + if(orig == (DWTID)-1) + { + DWThread = curr; + } while(((tv.tv_sec - start.tv_sec)*1000) + ((tv.tv_usec - start.tv_usec)/1000) <= milliseconds) { - if(orig == (DWTID)-1) - { - DWThread = curr; - } - dw_main_iteration(); - if(orig == (DWTID)-1) - { - DWThread = orig; - } - gettimeofday(&tv, NULL); + dw_main_iteration(); + gettimeofday(&tv, NULL); + } + if(orig == (DWTID)-1) + { + DWThread = orig; } dw_mutex_unlock(DWRunMutex); } @@ -6503,12 +6503,10 @@ */ if(DWThread == pthread_self()) { - pthread_mutex_unlock(DWRunMutex); while(pthread_mutex_trylock(mutex) != 0) { dw_main_iteration(); } - pthread_mutex_lock(DWRunMutex); } else {