Skip to content

Commit b34f19a

Browse files
authored
Ensure that a premature call to set_num_threads will not overwrite unrelated memory
1 parent 66904f8 commit b34f19a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

driver/others/blas_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ void goto_set_num_threads(int num_threads) {
973973

974974
increased_threads = 1;
975975

976-
for(i = blas_num_threads - 1; i < num_threads - 1; i++){
976+
for(i = (blas_num_threads > 0) ? blas_num_threads - 1 : 0; i < num_threads - 1; i++){
977977

978978
atomic_store_queue(&thread_status[i].queue, (blas_queue_t *)0);
979979
thread_status[i].status = THREAD_STATUS_WAKEUP;

0 commit comments

Comments
 (0)