diff options
author | Andreas Pape <apape@de.adit-jv.com> | 2022-03-29 10:12:07 +0200 |
---|---|---|
committer | Filipe Coelho <falktx@falktx.com> | 2022-03-29 11:49:24 +0100 |
commit | 58194d90f4321e0a8a0fbc5708a637e13f77159a (patch) | |
tree | 300bc7d5f2ace9e60deda7ed815f6a5e173eef12 | |
parent | 3a5e040155b6f8410a42bb92aa743a4be6929b07 (diff) | |
download | jack2-58194d90f4321e0a8a0fbc5708a637e13f77159a.tar.gz |
JackFifo: Apply given init value in allocate
When using as sync opbject the given 'value' is meant to
already 'unblock' for that amount of Wait calls.
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
-rwxr-xr-x | posix/JackFifo.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/posix/JackFifo.cpp b/posix/JackFifo.cpp index 1b39e50d..b811d689 100755 --- a/posix/JackFifo.cpp +++ b/posix/JackFifo.cpp @@ -149,11 +149,15 @@ bool JackFifo::Allocate(const char* name, const char* server_name, int value) if ((fFifo = open(fName, O_RDWR | O_CREAT, 0666)) < 0) { jack_error("Cannot open FIFO name = %s err = %s", name, strerror(errno)); return false; - } else { - fPoll.fd = fFifo; - fPoll.events = POLLERR | POLLIN | POLLHUP | POLLNVAL; - return true; } + + fPoll.fd = fFifo; + fPoll.events = POLLERR | POLLIN | POLLHUP | POLLNVAL; + while (value--) { + Signal(); + } + + return true; } // Client side |