Permalink
Browse files

Refs #136. Fixed a bug about controlling the number of threads on Win…

…dows.
  • Loading branch information...
1 parent 801383e commit fe4ab95cd511577d6629e48536321c1ea306699c @xianyi committed Aug 19, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 driver/others/blas_server_win32.c
View
10 driver/others/blas_server_win32.c
@@ -466,7 +466,17 @@ void goto_set_num_threads(int num_threads)
LOCK_COMMAND(&server_lock);
//increased_threads = 1;
+ if (!blas_server_avail){
+ InitializeCriticalSection(&pool.lock);
+ pool.filled = CreateEvent(NULL, FALSE, FALSE, NULL);
+ pool.killed = CreateEvent(NULL, TRUE, FALSE, NULL);
+
+ pool.shutdown = 0;
+ pool.queue = NULL;
+ blas_server_avail = 1;
+ }
+
for(i = blas_num_threads - 1; i < num_threads - 1; i++){
blas_threads[i] = CreateThread(NULL, 0,

0 comments on commit fe4ab95

Please sign in to comment.