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>
This commit is contained in:
Andreas Pape 2022-03-29 10:12:07 +02:00 committed by Filipe Coelho
parent 3a5e040155
commit 58194d90f4
1 changed files with 8 additions and 4 deletions

View File

@ -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