@ai-ecoverse/slicc-kernel 1.124.3 → 1.124.4

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.
@@ -6594,7 +6594,7 @@ function satisfies(version, range2) {
6594
6594
  }
6595
6595
 
6596
6596
  // src/version.ts
6597
- var KERNEL_VERSION = true ? "1.124.3" : "0.0.0-dev";
6597
+ var KERNEL_VERSION = true ? "1.124.4" : "0.0.0-dev";
6598
6598
  var OS_RELEASE = "6.0.0-slicc";
6599
6599
  function procVersion() {
6600
6600
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -7514,15 +7514,21 @@ var UnlinkedKeeper = class {
7514
7514
  };
7515
7515
  const unreplaced = async (path, op) => {
7516
7516
  const at = fs.resolvePath("/", path);
7517
+ const pending = async () => {
7518
+ for (let p = at; replacing.size > 0; p = parentOf5(p)) {
7519
+ await replacing.get(p)?.done;
7520
+ if (p === "/") return;
7521
+ }
7522
+ };
7517
7523
  for (let attempt = 1; ; attempt++) {
7518
- await replacing.get(at)?.done;
7524
+ await pending();
7519
7525
  const seen = keeper.replaced;
7520
7526
  try {
7521
7527
  return await op();
7522
7528
  } catch (err) {
7523
7529
  const code = err?.code;
7524
7530
  if (attempt >= 3 || code !== "ENOENT") throw err;
7525
- await replacing.get(at)?.done;
7531
+ await pending();
7526
7532
  if (keeper.replaced === seen) throw err;
7527
7533
  }
7528
7534
  }
@@ -7547,9 +7553,11 @@ var UnlinkedKeeper = class {
7547
7553
  lstat: (path) => unreplaced(path, async () => counted2(await fs.lstat(path))),
7548
7554
  async rm(path, options) {
7549
7555
  const target = fs.resolvePath("/", path);
7550
- const pinned = await keeper.pin(target);
7551
- if (pinned.moved.has(target)) pinned.commit();
7552
- else await keeper.settle(pinned, () => fs.rm(path, options));
7556
+ await replace(target, async (gated) => {
7557
+ const pinned = await keeper.pin(target, gated);
7558
+ if (pinned.moved.has(target)) pinned.commit();
7559
+ else await keeper.settle(pinned, () => fs.rm(path, options));
7560
+ });
7553
7561
  },
7554
7562
  async rename(from, to) {
7555
7563
  const target = fs.resolvePath("/", to);
@@ -7584,9 +7592,22 @@ var UnlinkedKeeper = class {
7584
7592
  return held;
7585
7593
  }
7586
7594
  async pin(target, gated = () => void 0) {
7587
- const paths = [...this.heldWithin(target).keys()].sort();
7595
+ const paths = [];
7588
7596
  const releases = [];
7589
- for (const path of paths) releases.push(await this.gate.acquire(path));
7597
+ for (; ; ) {
7598
+ const fresh2 = [...this.heldWithin(target).keys()].filter((path) => !paths.includes(path));
7599
+ if (fresh2.length === 0) break;
7600
+ fresh2.sort();
7601
+ if (paths.some((path) => path > fresh2[0])) {
7602
+ for (const release of releases.splice(0)) release();
7603
+ fresh2.push(...paths.splice(0));
7604
+ fresh2.sort();
7605
+ }
7606
+ for (const path of fresh2) {
7607
+ paths.push(path);
7608
+ releases.push(await this.gate.acquire(path));
7609
+ }
7610
+ }
7590
7611
  gated();
7591
7612
  const now = this.heldWithin(target);
7592
7613
  const held = new Map(