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 {
25172517
25182518 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.
25212521 pub const Id = if (use_pthreads)
25222522 c.pthread_t
25232523 else switch (builtin.os) {
std/os/test.zig+2-2
......@@ -34,12 +34,12 @@ test "access file" {
3434 try os.deleteTree(a, "os_test_tmp");
3535}
3636
37fn testThreadIdFn(threadId: *?os.Thread.Id) void {
37fn testThreadIdFn(threadId: *os.Thread.Id) void {
3838 threadId.* = os.Thread.currentId();
3939}
4040
4141test "std.os.Thread.currentId" {
42 var threadCurrentId: ?os.Thread.Id = null;
42 var threadCurrentId: os.Thread.Id = undefined;
4343 const thread = try os.spawnThread(&threadCurrentId, testThreadIdFn);
4444 const threadId = thread.id();
4545 thread.wait();