diff options
| author | William Boman <william@redwill.se> | 2023-11-07 00:25:16 +0100 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2025-02-19 09:23:19 +0100 |
| commit | 0329de4920a838e9196a5e2137e5d55f9ec7537c (patch) | |
| tree | 1c68454cc36f2c5faa8498497a0f2bb47437516b /lua/mason-core/async/control.lua | |
| parent | refactor: standardize constructors and improve inheritance construction (diff) | |
| download | mason-0329de4920a838e9196a5e2137e5d55f9ec7537c.tar mason-0329de4920a838e9196a5e2137e5d55f9ec7537c.tar.gz mason-0329de4920a838e9196a5e2137e5d55f9ec7537c.tar.bz2 mason-0329de4920a838e9196a5e2137e5d55f9ec7537c.tar.lz mason-0329de4920a838e9196a5e2137e5d55f9ec7537c.tar.xz mason-0329de4920a838e9196a5e2137e5d55f9ec7537c.tar.zst mason-0329de4920a838e9196a5e2137e5d55f9ec7537c.zip | |
fix(async): also check async context termination immediately after suspending
Diffstat (limited to 'lua/mason-core/async/control.lua')
| -rw-r--r-- | lua/mason-core/async/control.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/mason-core/async/control.lua b/lua/mason-core/async/control.lua index 2388bce5..30ce982c 100644 --- a/lua/mason-core/async/control.lua +++ b/lua/mason-core/async/control.lua @@ -50,7 +50,7 @@ function Permit:forget() if semaphore.permits > 0 and #semaphore.handles > 0 then semaphore.permits = semaphore.permits - 1 local release = table.remove(semaphore.handles, 1) - release(Permit:new(semaphore)) + release() end end @@ -73,7 +73,7 @@ function Semaphore:acquire() if self.permits > 0 then self.permits = self.permits - 1 else - return a.wait(function(resolve) + a.wait(function(resolve) table.insert(self.handles, resolve) end) end |
