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

It doesn't work, because of issue #1332.
This commit is contained in:
Matthew D. Steele 2018-08-04 21:47:13 -04:00
parent a25824e033
commit 7a2401ef1e
2 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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();