@ai-ecoverse/slicc-kernel 1.100.4 → 1.102.0

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/dist/node.js CHANGED
@@ -11107,7 +11107,7 @@ var PATH_OPS = new Set(SYNC_FS_OPS);
11107
11107
  var EARLY_WHOLE_FILE = 64 * 1024;
11108
11108
 
11109
11109
  // src/version.ts
11110
- var KERNEL_VERSION = true ? "1.100.4" : "0.0.0-dev";
11110
+ var KERNEL_VERSION = true ? "1.102.0" : "0.0.0-dev";
11111
11111
  var OS_RELEASE = "6.0.0-slicc";
11112
11112
  function procVersion() {
11113
11113
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -14252,13 +14252,6 @@ var SEM_NAMES_MAX = 4096;
14252
14252
  var SEM_HANDLES_MAX = 256;
14253
14253
  var NAME_MAX = 251;
14254
14254
  var TIMER_MAX_MS = 2147483647;
14255
- var deadlines = /* @__PURE__ */ new WeakMap();
14256
- function timeLeft(req, timeoutMs) {
14257
- const now = performance.now();
14258
- const deadline = deadlines.get(req) ?? now + timeoutMs;
14259
- deadlines.set(req, deadline);
14260
- return Math.max(0, deadline - now);
14261
- }
14262
14255
  var SEM_OPS = [
14263
14256
  "sem-open",
14264
14257
  "sem-close",
@@ -14445,9 +14438,8 @@ async function semSyscall(req, proc) {
14445
14438
  const sem = handles.get(req.handle);
14446
14439
  if (sem.take()) return ok2();
14447
14440
  if (req.how === "try") throw new KernelError("EAGAIN");
14448
- const timeoutMs = req.how === "block" ? -1 : timeLeft(req, req.timeoutMs);
14449
- if (timeoutMs === 0) throw new KernelError("ETIMEDOUT");
14450
- const got = await sem.wait(proc.blocking(), timeoutMs);
14441
+ if (req.how === "timed" && req.timeoutMs === 0) throw new KernelError("ETIMEDOUT");
14442
+ const got = await sem.wait(proc.blocking(), req.how === "block" ? -1 : req.timeoutMs);
14451
14443
  if (!got) throw new KernelError("ETIMEDOUT");
14452
14444
  return ok2();
14453
14445
  }
@@ -15470,7 +15462,7 @@ function identityKey(st, path) {
15470
15462
  }
15471
15463
  var DYING = { ok: false, errno: "EINTR", message: "the process is being killed" };
15472
15464
  var HOSTS_ONLY = new Resolver({ routes: new Routes() });
15473
- function timeLeft2(req, started) {
15465
+ function timeLeft(req, started) {
15474
15466
  if (!("timeoutMs" in req) || typeof req.timeoutMs !== "number" || req.timeoutMs < 0) return req;
15475
15467
  return { ...req, timeoutMs: Math.max(0, req.timeoutMs - (performance.now() - started)) };
15476
15468
  }
@@ -15640,7 +15632,7 @@ var WasmProcess = class {
15640
15632
  for (; ; ) {
15641
15633
  await this.resumed;
15642
15634
  if (this.dying) return DYING;
15643
- const current = restarted ? timeLeft2(req, started) : req;
15635
+ const current = restarted ? timeLeft(req, started) : req;
15644
15636
  const stops = this.stops;
15645
15637
  const scope = new AbortController();
15646
15638
  const forward = () => scope.abort();