Commit 7a2401ef1e

Matthew D. Steele <mdsteele@alum.mit.edu>
2018-08-05 03:47:13
Don't compare ?Thread.Id == Thread.Id in the test
It doesn't work, because of issue #1332.
1 parent a25824e
Changed files (2)
std/os/index.zig
@@ -2517,7 +2517,7 @@ pub const Thread = struct {
 
     pub const use_pthreads = is_posix and builtin.link_libc;
 
-    /// An opaque type representing a kernel thread ID.
+    /// An type representing a kernel thread ID.
     pub const Id = if (use_pthreads)
         c.pthread_t
     else switch (builtin.os) {
std/os/test.zig
@@ -34,12 +34,12 @@ test "access file" {
     try os.deleteTree(a, "os_test_tmp");
 }
 
-fn testThreadIdFn(threadId: *?os.Thread.Id) void {
+fn testThreadIdFn(threadId: *os.Thread.Id) void {
     threadId.* = os.Thread.currentId();
 }
 
 test "std.os.Thread.currentId" {
-    var threadCurrentId: ?os.Thread.Id = null;
+    var threadCurrentId: os.Thread.Id = undefined;
     const thread = try os.spawnThread(&threadCurrentId, testThreadIdFn);
     const threadId = thread.id();
     thread.wait();