| ... | ... | @@ -46,13 +46,17 @@ test "std.os.Thread.getCurrentId" { |
| 46 | 46 | const thread = try os.spawnThread(&thread_current_id, testThreadIdFn); |
| 47 | 47 | const thread_id = thread.handle(); |
| 48 | 48 | thread.wait(); |
| 49 | | switch (builtin.os) { |
| 50 | | builtin.Os.windows => expect(os.Thread.getCurrentId() != thread_current_id), |
| 51 | | else => { |
| 52 | | // If the thread completes very quickly, then thread_id can be 0. See the |
| 53 | | // documentation comments for `std.os.Thread.handle`. |
| 54 | | expect(thread_id == 0 or thread_current_id == thread_id); |
| 55 | | }, |
| 49 | if (os.Thread.use_pthreads) { |
| 50 | expect(thread_current_id == thread_id); |
| 51 | } else { |
| 52 | switch (builtin.os) { |
| 53 | builtin.Os.windows => expect(os.Thread.getCurrentId() != thread_current_id), |
| 54 | else => { |
| 55 | // If the thread completes very quickly, then thread_id can be 0. See the |
| 56 | // documentation comments for `std.os.Thread.handle`. |
| 57 | expect(thread_id == 0 or thread_current_id == thread_id); |
| 58 | }, |
| 59 | } |
| 56 | 60 | } |
| 57 | 61 | } |
| 58 | 62 | |