Acts as a critical section which processes can use to block each other. More...
#include <juce_InterProcessLock.h>
Classes | |
class | Pimpl |
class | ScopedLockType |
Automatically locks and unlocks an InterProcessLock object. More... | |
Public Member Functions | |
InterProcessLock (const String &name) | |
Creates a lock object. More... | |
~InterProcessLock () | |
Destructor. More... | |
bool | enter (int timeOutMillisecs=-1) |
Attempts to lock the critical section. More... | |
void | exit () |
Releases the lock if it's currently held by this process. More... | |
Private Attributes | |
CriticalSection | lock |
String | name |
ScopedPointer< Pimpl > | pimpl |
Friends | |
struct | ContainerDeletePolicy< Pimpl > |
Acts as a critical section which processes can use to block each other.
|
explicit |
Creates a lock object.
name | a name that processes will use to identify this lock object |
InterProcessLock::~InterProcessLock | ( | ) |
Destructor.
This will also release the lock if it's currently held by this process.
bool InterProcessLock::enter | ( | int | timeOutMillisecs = -1 | ) |
Attempts to lock the critical section.
timeOutMillisecs | how many milliseconds to wait if the lock is already held by another process - a value of 0 will return immediately, negative values will wait forever |
References InterProcessLock::Pimpl::handle, lock, name, pimpl, and InterProcessLock::Pimpl::refCount.
Referenced by InterProcessLock::ScopedLockType::ScopedLockType().
void InterProcessLock::exit | ( | ) |
Releases the lock if it's currently held by this process.
References androidJNIJavaVM, jassert, juce_threadEntryPoint(), lock, pimpl, InterProcessLock::Pimpl::refCount, and threadEntryProc().
Referenced by ChildProcess::ActiveProcess::ActiveProcess().
|
friend |
|
private |
|
private |