From 9bce51f651aad297ef9eb6df832bfdaf1de05d84 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 22 四月 2026 14:27:54 +0800
Subject: [PATCH] 青岛推送
---
node_modules/webpack/lib/util/Semaphore.js | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/node_modules/webpack/lib/util/Semaphore.js b/node_modules/webpack/lib/util/Semaphore.js
index 66b9ad9..2ddddd0 100644
--- a/node_modules/webpack/lib/util/Semaphore.js
+++ b/node_modules/webpack/lib/util/Semaphore.js
@@ -5,9 +5,14 @@
"use strict";
+/**
+ * Simple counting semaphore used to limit how many asynchronous tasks may run
+ * concurrently.
+ */
class Semaphore {
/**
- * Creates an instance of Semaphore.
+ * Initializes the semaphore with the number of permits that may be held at
+ * the same time.
* @param {number} available the amount available number of "tasks"
* in the Semaphore
*/
@@ -20,6 +25,8 @@
}
/**
+ * Acquires a permit for the callback immediately when one is available or
+ * queues the callback until another task releases its permit.
* @param {() => void} callback function block to capture and run
* @returns {void}
*/
@@ -32,6 +39,9 @@
}
}
+ /**
+ * Releases a permit and schedules the next waiting callback, if any.
+ */
release() {
this.available++;
if (this.waiters.length > 0) {
@@ -39,6 +49,9 @@
}
}
+ /**
+ * Drains the next waiting callback after a permit becomes available.
+ */
_continue() {
if (this.available > 0 && this.waiters.length > 0) {
this.available--;
--
Gitblit v1.9.3