authorgravatar for mdsteele@alum.mit.eduMatthew D. Steele <mdsteele@alum.mit.edu> 2018-08-04 21:47:13-04:00
committergravatar for mdsteele@alum.mit.eduMatthew D. Steele <mdsteele@alum.mit.edu> 2018-08-04 21:47:13-04:00
log7a2401ef1eca3446279469b092e6f9c9653e38f8
tree214da45b9c1b0696b35dc4bfc02f77f14a1c25e1
parenta25824e033d11a8ada0d444efab9ac08a93185af

Don't compare ?Thread.Id == Thread.Id in the test

It doesn't work, because of issue #1332.

2 files changed, 3 insertions(+), 3 deletions(-)

std/os/index.zig+1-1
...@@ -2517,7 +2517,7 @@ pub const Thread = struct {...@@ -2517,7 +2517,7 @@ pub const Thread = struct {
25172517
2518 pub const use_pthreads = is_posix and builtin.link_libc;2518 pub const use_pthreads = is_posix and builtin.link_libc;
25192519
2520 /// An opaque type representing a kernel thread ID.2520 /// An type representing a kernel thread ID.
2521 pub const Id = if (use_pthreads)2521 pub const Id = if (use_pthreads)
2522 c.pthread_t2522 c.pthread_t
2523 else switch (builtin.os) {2523 else switch (builtin.os) {
std/os/test.zig+2-2
...@@ -34,12 +34,12 @@ test "access file" {...@@ -34,12 +34,12 @@ test "access file" {
34 try os.deleteTree(a, "os_test_tmp");34 try os.deleteTree(a, "os_test_tmp");
35}35}
3636
37fn testThreadIdFn(threadId: *?os.Thread.Id) void {37fn testThreadIdFn(threadId: *os.Thread.Id) void {
38 threadId.* = os.Thread.currentId();38 threadId.* = os.Thread.currentId();
39}39}
4040
41test "std.os.Thread.currentId" {41test "std.os.Thread.currentId" {
42 var threadCurrentId: ?os.Thread.Id = null;42 var threadCurrentId: os.Thread.Id = undefined;
43 const thread = try os.spawnThread(&threadCurrentId, testThreadIdFn);43 const thread = try os.spawnThread(&threadCurrentId, testThreadIdFn);
44 const threadId = thread.id();44 const threadId = thread.id();
45 thread.wait();45 thread.wait();