Skip to content

Commit 7a2401e

Browse files
committed
Don't compare ?Thread.Id == Thread.Id in the test
It doesn't work, because of issue ziglang#1332.
1 parent a25824e commit 7a2401e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

std/os/index.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ test "access file" {
3434
try os.deleteTree(a, "os_test_tmp");
3535
}
3636

37-
fn testThreadIdFn(threadId: *?os.Thread.Id) void {
37+
fn testThreadIdFn(threadId: *os.Thread.Id) void {
3838
threadId.* = os.Thread.currentId();
3939
}
4040

4141
test "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();

0 commit comments

Comments
 (0)