Important Mutexes
(→RefObject::refMutex() (singleton, public)) |
|||
(One intermediate revision by one user not shown) | |||
Line 31: | Line 31: | ||
The list holding the installed message handlers is protected against changes by this mutex while it's being iterated. Usually the only instance of dispatcher is the derived '''Engine''' singleton object. | The list holding the installed message handlers is protected against changes by this mutex while it's being iterated. Usually the only instance of dispatcher is the derived '''Engine''' singleton object. | ||
+ | |||
'''See also''' | '''See also''' | ||
Line 36: | Line 37: | ||
*[[Mutexes and locking]] | *[[Mutexes and locking]] | ||
*[[Locking Issues]] | *[[Locking Issues]] | ||
+ | |||
+ | [[Category:Programmers]] [[Category:Mutexes]] |
Latest revision as of 13:46, 4 November 2013
In the code of Yate there are some noteworthy mutexes that have program-wide implications.
Contents |
[edit] RefObject::refMutex() (singleton, public)
This is the most important mutex in Yate, it locks RefObject derived objects while their reference counter is modified. It is acquired and released billions of times in any Yate run. The code executed with this mutex acquired is strictly limited and the actual object destruction (when the reference counter dropped to zero) is performed with this mutex released.
[edit] DataEndpoint::commonMutex() (singleton, public)
This mutex protects data endpoint while their source and consumers are connected or disconnected. This makes sure that operations changing the data sources or consumers of data endpoints occur atomically.
[edit] CallEndpoint::commonMutex() (singleton, public)
Call endpoint connect and disconnect operations are protected by this mutex.
Please note that during the connect() or disconnect() methods usually there will be one or more calls that will need to acquire the DataEndpoint mutex.
[edit] Module (itself, public)
The module (and derived Driver) class is derived from several classes including Mutex. Each module uses itself to perform atomic update operations.
[edit] DataSource::mutex() (public)
Each DataSource has a mutex that is acquired while accessing its Consumer list.
[edit]
This mutex protects the list of translator factories while it's used or updated.
[edit]
The list holding the installed message handlers is protected against changes by this mutex while it's being iterated. Usually the only instance of dispatcher is the derived Engine singleton object.
See also