@zigc/lib 0.17.0-dev.263 → 0.17.0-dev.269
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/std/Io.zig +11 -9
- package/std/Thread.zig +3 -0
- package/std/os/emscripten.zig +1 -0
package/package.json
CHANGED
package/std/Io.zig
CHANGED
|
@@ -54,9 +54,6 @@ pub const VTable = struct {
|
|
|
54
54
|
/// If it returns `null` it means `result` has been already populated and
|
|
55
55
|
/// `await` will be a no-op.
|
|
56
56
|
///
|
|
57
|
-
/// When this function returns non-null, the implementation guarantees that
|
|
58
|
-
/// a unit of concurrency has been assigned to the returned task.
|
|
59
|
-
///
|
|
60
57
|
/// Thread-safe.
|
|
61
58
|
async: *const fn (
|
|
62
59
|
/// Corresponds to `Io.userdata`.
|
|
@@ -111,10 +108,6 @@ pub const VTable = struct {
|
|
|
111
108
|
result_alignment: std.mem.Alignment,
|
|
112
109
|
) void,
|
|
113
110
|
|
|
114
|
-
/// When this function returns, implementation guarantees that `start` has
|
|
115
|
-
/// either already been called, or a unit of concurrency has been assigned
|
|
116
|
-
/// to the task of calling the function.
|
|
117
|
-
///
|
|
118
111
|
/// Thread-safe.
|
|
119
112
|
groupAsync: *const fn (
|
|
120
113
|
/// Corresponds to `Io.userdata`.
|
|
@@ -1251,8 +1244,11 @@ pub const Group = struct {
|
|
|
1251
1244
|
/// cancelation propagation boundary.
|
|
1252
1245
|
///
|
|
1253
1246
|
/// Once this function is called, there are resources associated with the
|
|
1254
|
-
/// group. To release those resources, `
|
|
1255
|
-
///
|
|
1247
|
+
/// group. To release those resources, `await` or `cancel` must eventually
|
|
1248
|
+
/// be called.
|
|
1249
|
+
///
|
|
1250
|
+
/// `function` is not guaranteed to have been called until `await` or
|
|
1251
|
+
/// `cancel` is called.
|
|
1256
1252
|
pub fn async(g: *Group, io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) void {
|
|
1257
1253
|
const Args = @TypeOf(args);
|
|
1258
1254
|
const TypeErased = struct {
|
|
@@ -1290,6 +1286,9 @@ pub const Group = struct {
|
|
|
1290
1286
|
/// will also cause `error.Canceled` to be returned when the group
|
|
1291
1287
|
/// does ultimately finish.
|
|
1292
1288
|
///
|
|
1289
|
+
/// After this function returns, all tasks of the `Group` created with
|
|
1290
|
+
/// `async` or `concurrent` are guaranteed to have run.
|
|
1291
|
+
///
|
|
1293
1292
|
/// Idempotent. Not threadsafe.
|
|
1294
1293
|
///
|
|
1295
1294
|
/// It is safe to call this function concurrently with `Group.async` or
|
|
@@ -1304,6 +1303,9 @@ pub const Group = struct {
|
|
|
1304
1303
|
/// Equivalent to `await` but immediately requests cancelation on all
|
|
1305
1304
|
/// members of the group.
|
|
1306
1305
|
///
|
|
1306
|
+
/// After this function returns, all tasks of the `Group` created with
|
|
1307
|
+
/// `async` or `concurrent` are guaranteed to have run.
|
|
1308
|
+
///
|
|
1307
1309
|
/// For a description of cancelation and cancelation points, see `Future.cancel`.
|
|
1308
1310
|
///
|
|
1309
1311
|
/// Idempotent. Not threadsafe.
|
package/std/Thread.zig
CHANGED
|
@@ -695,6 +695,9 @@ const PosixThreadImpl = struct {
|
|
|
695
695
|
.linux => {
|
|
696
696
|
return LinuxThreadImpl.getCpuCount();
|
|
697
697
|
},
|
|
698
|
+
.emscripten => {
|
|
699
|
+
return @as(usize, @intCast(std.os.emscripten.emscripten_num_logical_cores()));
|
|
700
|
+
},
|
|
698
701
|
.openbsd => {
|
|
699
702
|
var count: c_int = undefined;
|
|
700
703
|
var count_size: usize = @sizeOf(c_int);
|
package/std/os/emscripten.zig
CHANGED
|
@@ -882,6 +882,7 @@ pub extern "c" fn emscripten_hide_mouse() void;
|
|
|
882
882
|
pub extern "c" fn emscripten_set_canvas_size(width: c_int, height: c_int) void;
|
|
883
883
|
pub extern "c" fn emscripten_get_canvas_size(width: *c_int, height: *c_int, isFullscreen: *c_int) void;
|
|
884
884
|
pub extern "c" fn emscripten_get_now() f64;
|
|
885
|
+
pub extern "c" fn emscripten_num_logical_cores() c_int;
|
|
885
886
|
pub extern "c" fn emscripten_random() f32;
|
|
886
887
|
pub const em_idb_onload_func = ?*const fn (?*anyopaque, ?*anyopaque, c_int) callconv(.c) void;
|
|
887
888
|
pub extern "c" fn emscripten_idb_async_load(db_name: [*:0]const u8, file_id: [*:0]const u8, arg: ?*anyopaque, onload: em_idb_onload_func, onerror: em_arg_callback_func) void;
|