API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

AEECLSID_CRITSECT

Brew Release
Brew MP 1.0.2
Description

AEECLSID_CritSect specifies a "critical section" object, also known as a "lock" or a "mutex". Instances of this class are used to synchronize multiple threads that manipulate shared data. Characeristics of this class include:
1. Per-instance locking. Each time CreateInstance() is called with this class ID, a new instance is returned. Threads acquiring the instance (via ICritSect_Enter) will contend only with other threads acquiring the same instance.
2. Priority inheritance. When one thread holds the lock and a higher priority thread blocks on acquiring the lock (via ICritSect_Enter) the holding thread will execute with the higher priority until it releases the lock (via ICritSect_Leave).
3. Re-entrancy. Once a thread has acquired the lock, it "owns" the lock and may re-acquire the lock any number of times by calling ICritSect_Enter() again. Such a thread will hold the lock until it releases by calling ICritSect_Leave() an equivalent number of times. Only the owning thread may release the lock. Locks of this sort are sometimes termed "owned" or "counting" locks.
4. Intra-process. Instances are intended to be used by clients that reside in the same process. Since ICritSect is a remotable interface, references to a single instance *can* be passed to other processes and the lock *can* be acquired and released by clients in other processes via remote invocation. This is not recommended, however, because the instance will reside in the process that originally created it, and remote invocation will involve overheads (and a potential for deadlock when single-threaded environments are involved) that are avoidable by using AEECLSID_InterProcessCritSect.
MT-safe: Instances of this class can be used safely by multiple threads.
Default Interface Name