File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -669,9 +669,15 @@ int exec_blas_async(BLASLONG pos, blas_queue_t *queue){
669
669
} while (1 );
670
670
671
671
} else {
672
- while (thread_status [i ].queue ) {
672
+ pthread_mutex_lock (& thread_status [i ].lock );
673
+ tsiq = thread_status [i ].queue ;
674
+ pthread_mutex_unlock (& thread_status [i ].lock );
675
+ while (tsiq ) {
673
676
i ++ ;
674
677
if (i >= blas_num_threads - 1 ) i = 0 ;
678
+ pthread_mutex_lock (& thread_status [i ].lock );
679
+ tsiq = thread_status [i ].queue ;
680
+ pthread_mutex_unlock (& thread_status [i ].lock );
675
681
}
676
682
}
677
683
#else
@@ -960,14 +966,10 @@ int BLASFUNC(blas_thread_shutdown)(void){
960
966
961
967
for (i = 0 ; i < blas_num_threads - 1 ; i ++ ) {
962
968
963
- blas_lock ( & exec_queue_lock );
969
+ pthread_mutex_lock ( & thread_status [ i ]. lock );
964
970
965
971
thread_status [i ].queue = (blas_queue_t * )-1 ;
966
972
967
- blas_unlock (& exec_queue_lock );
968
-
969
- pthread_mutex_lock (& thread_status [i ].lock );
970
-
971
973
thread_status [i ].status = THREAD_STATUS_WAKEUP ;
972
974
973
975
pthread_cond_signal (& thread_status [i ].wakeup );
You can’t perform that action at this time.
0 commit comments