Browse Source

Update thread_windows.odin

`n` was left over being always zero. But you want `win32.WaitForMultipleObjects` to be the number of threads to wait for which u already have with `j`.
Patric Dexheimer 4 years ago
parent
commit
2231f02f61
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/thread/thread_windows.odin

+ 2 - 2
core/thread/thread_windows.odin

@@ -92,7 +92,7 @@ join_multiple :: proc(threads: ..^Thread) {
 
 	for k := 0; k < len(threads); k += MAXIMUM_WAIT_OBJECTS {
 		count := min(len(threads) - k, MAXIMUM_WAIT_OBJECTS);
-		n, j := u32(0), 0;
+		j := u32(0);
 		for i in 0..<count {
 			handle := threads[i+k].win32_thread;
 			if handle != win32.INVALID_HANDLE {
@@ -100,7 +100,7 @@ join_multiple :: proc(threads: ..^Thread) {
 				j += 1;
 			}
 		}
-		win32.WaitForMultipleObjects(n, &handles[0], true, win32.INFINITE);
+		win32.WaitForMultipleObjects(j, &handles[0], true, win32.INFINITE);
 	}
 
 	for t in threads {