mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-19 01:04:20 +00:00
IPC: Avoid deadlocks when destroying pipes
Previously, calls to `open` blocked when creating a writeable pipe. This could cause other calls to block indefinitely, waiting for the pipe to become available. Now, we open the pipe in nonblocking mode, which allows us to retry indefinitely, checking `stopReadOperation` each time to find out whether `close` has been called and allowing a graceful exit.
This commit is contained in:
parent
472fac976b
commit
84be2fea9a
1 changed files with 1 additions and 1 deletions
|
|
@ -154,7 +154,7 @@ private:
|
|||
bool openPipe (bool isInput, uint32 timeoutEnd)
|
||||
{
|
||||
auto& pipe = isInput ? pipeIn : pipeOut;
|
||||
int flags = isInput ? O_RDWR | O_NONBLOCK : O_WRONLY;
|
||||
int flags = (isInput ? O_RDWR : O_WRONLY) | O_NONBLOCK;
|
||||
|
||||
const String& pipeName = isInput ? (createdPipe ? pipeInName : pipeOutName)
|
||||
: (createdPipe ? pipeOutName : pipeInName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue