mirror of
https://github.com/soarqin/DSP_Mods_TO.git
synced 2026-08-07 01:00:11 +08:00
fix(compresssave): wait for async worker before closing save
This commit is contained in:
@@ -68,6 +68,8 @@ public class DoubleBuffer(byte[] readingBuffer, byte[] writingBuffer, Action onR
|
||||
private readonly Semaphore _readEnd = new(1, 1);
|
||||
private readonly Semaphore _writeEnd = new(0, 1);
|
||||
|
||||
public bool HasPendingBuffer => _readBuffer != null;
|
||||
|
||||
public ByteSpan ReadBegin()
|
||||
{
|
||||
_writeEnd.WaitOne();
|
||||
@@ -112,4 +114,4 @@ public class DoubleBuffer(byte[] readingBuffer, byte[] writingBuffer, Action onR
|
||||
{
|
||||
_writeEnd.Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user