mirror of
https://github.com/ziglang/zig.git
synced 2026-02-18 07:18:38 +00:00
Don't compare ?Thread.Id == Thread.Id in the test
It doesn't work, because of issue #1332.
This commit is contained in:
parent
a25824e033
commit
7a2401ef1e
@ -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) {
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user