mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: fix lock aquire
This commit is contained in:
1 parent
72053d7a37
commit
95be2f95a5
2 files changed
+3
-2
No files matched your search
@@ -57,7 +57,8 @@ export namespace Lock {
|
||||
const data = {};
|
||||
|
||||
export async function aquire(key: string) {
|
||||
while (data[key]) sleep(100);
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
while (data[key]) await sleep(100);
|
||||
data[key] = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user