Skip to content

Commit

Permalink
fix shared deadlock chain
Browse files Browse the repository at this point in the history
  • Loading branch information
YiraSan committed Jan 28, 2025
1 parent 387dbc2 commit 622d664
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/coro/sync.zig
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,11 @@ test "RwLock.Cancel" {

fn locksharer(lock: *RwLock) !void {
while (true) {
// simulates a "workload"
try coro.io.single(.timeout, .{ .ns = std.time.ns_per_ms });

try lock.lockShared();
defer lock.unlock();

// simulates a "workload"
try coro.io.single(.timeout, .{ .ns = 16 * std.time.ns_per_ms });
}
}

Expand Down

0 comments on commit 622d664

Please sign in to comment.