mirror of
https://github.com/ziglang/zig.git
synced 2024-11-17 01:23:54 +00:00
stage2: Only bypass flock
on WASI
This commit is contained in:
parent
bb9cd6db1c
commit
f8dc6fc416
@ -762,7 +762,11 @@ pub const Manifest = struct {
|
||||
|
||||
fn downgradeToSharedLock(self: *Manifest) !void {
|
||||
if (!self.have_exclusive_lock) return;
|
||||
if (std.process.can_spawn or !builtin.single_threaded) { // Some targets (WASI) do not support flock
|
||||
|
||||
// WASI does not currently support flock, so we bypass it here.
|
||||
// TODO: If/when flock is supported on WASI, this check should be removed.
|
||||
// See https://github.com/WebAssembly/wasi-filesystem/issues/2
|
||||
if (builtin.os.tag != .wasi or std.process.can_spawn or !builtin.single_threaded) {
|
||||
const manifest_file = self.manifest_file.?;
|
||||
try manifest_file.downgradeLock();
|
||||
}
|
||||
@ -771,7 +775,11 @@ pub const Manifest = struct {
|
||||
|
||||
fn upgradeToExclusiveLock(self: *Manifest) !void {
|
||||
if (self.have_exclusive_lock) return;
|
||||
if (std.process.can_spawn or !builtin.single_threaded) { // Some targets (WASI) do not support flock
|
||||
|
||||
// WASI does not currently support flock, so we bypass it here.
|
||||
// TODO: If/when flock is supported on WASI, this check should be removed.
|
||||
// See https://github.com/WebAssembly/wasi-filesystem/issues/2
|
||||
if (builtin.os.tag != .wasi or std.process.can_spawn or !builtin.single_threaded) {
|
||||
const manifest_file = self.manifest_file.?;
|
||||
// Here we intentionally have a period where the lock is released, in case there are
|
||||
// other processes holding a shared lock.
|
||||
|
Loading…
Reference in New Issue
Block a user