Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ziglang/zig
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b6eb404831e4
Choose a base ref
...
head repository: ziglang/zig
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b5cfbfd84ee2
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 10, 2018

  1. enable basic event loop test

    andrewrk committed Jul 10, 2018
    Copy the full SHA
    1b82a9d View commit details
  2. fix regression from b6eb404

    andrewrk committed Jul 10, 2018
    Copy the full SHA
    b5cfbfd View commit details
Showing with 8 additions and 7 deletions.
  1. +1 −0 std/event/locked.zig
  2. +7 −7 std/event/loop.zig
1 change: 1 addition & 0 deletions std/event/locked.zig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const std = @import("../index.zig");
const Lock = std.event.Lock;
const Loop = std.event.Loop;

/// Thread-safe async/await lock that protects one piece of data.
/// Does not make any syscalls - coroutines which are waiting for the lock are suspended, and
14 changes: 7 additions & 7 deletions std/event/loop.zig
Original file line number Diff line number Diff line change
@@ -564,14 +564,14 @@ pub const Loop = struct {
};

test "std.event.Loop - basic" {
//var da = std.heap.DirectAllocator.init();
//defer da.deinit();
var da = std.heap.DirectAllocator.init();
defer da.deinit();

//const allocator = &da.allocator;
const allocator = &da.allocator;

//var loop: Loop = undefined;
//try loop.initMultiThreaded(allocator);
//defer loop.deinit();
var loop: Loop = undefined;
try loop.initMultiThreaded(allocator);
defer loop.deinit();

//loop.run();
loop.run();
}