mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Don't pull in a dependency on pthread_kill in single-threaded builds
Fixes a regression preventing single-threaded Emscripten builds from linking successfully without passing `-pthread` to emcc.
This commit is contained in:
parent
aa4332fb0e
commit
d05156eb71
1 changed files with 4 additions and 2 deletions
|
|
@ -797,9 +797,10 @@ fn await(
|
|||
result_alignment: std.mem.Alignment,
|
||||
) void {
|
||||
_ = result_alignment;
|
||||
if (builtin.single_threaded) return;
|
||||
const t: *Threaded = @ptrCast(@alignCast(userdata));
|
||||
const closure: *AsyncClosure = @ptrCast(@alignCast(any_future));
|
||||
closure.waitAndDeinit(t.allocator, result);
|
||||
const ac: *AsyncClosure = @ptrCast(@alignCast(any_future));
|
||||
ac.waitAndDeinit(t.allocator, result);
|
||||
}
|
||||
|
||||
fn cancel(
|
||||
|
|
@ -809,6 +810,7 @@ fn cancel(
|
|||
result_alignment: std.mem.Alignment,
|
||||
) void {
|
||||
_ = result_alignment;
|
||||
if (builtin.single_threaded) return;
|
||||
const t: *Threaded = @ptrCast(@alignCast(userdata));
|
||||
const ac: *AsyncClosure = @ptrCast(@alignCast(any_future));
|
||||
ac.closure.requestCancel();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue