class Synchronizable
|
Synchronizable. More... |
Full name | Coral::Synchronizable |
Definition | #include <synchronizable.h> |
Inherited by | AdvancedAudioDecoder, AudioServer, CongestionManager, CongestionManagerClient, CongestionMonitor, MultiAudioWriter, NetLogWriter, NetworkMonitor, RTCPAbstractServer, RTCPReceiver, RTCPSender, RTPReceiver, RTPSender, RoundTripTimePinger, SimpleAudioDecoder, SourceStateInfo, SpectrumAnalyzer, Thread, TimedThread, TrafficShaper, TrafficShaperSingleton |
List of all Methods |
|
|
Public Methods
Detailed Description
This class realizes synchronized access to a thread's data by other threads.
Synchronization is done by using a global pthread mutex and obtaining
access to this mutex by synchronized() for synchronized access and releasing
this mutex for unsynchronized access.
IMPORTANT: Do *not* use synchronized()/unsynchronized() within async signal
handlers. This may cause deadlocks. See PThread's pthread_mutex_lock man-page,
section "Async Signal Safety" for more information!
Constructor
Destructor
inline void synchronized ()
|
synchronized() begins a synchronized block. The block has to be
finished by unsynchronized(). synchronized() will wait until the mutex
is available.
See also: unsynchronized, synchronizedTry
inline bool synchronizedTry ()
|
synchronizedTry() tries to begins a synchronized block. It does the same
as synchronized(), but returns immediately, if the mutex is obtained by
another thread.
See also: synchronized, unsynchronized
inline void unsynchronized ()
|
unsynchronized() ends a synchronized block, which has begun by
synchronized().
Do reinitialization of Synchronizable.
void synchronized_debug (const char* file, const cardinal line)
|
Debug version of synchronized. This will print PID, file name
and line number, followed by debug information.
Parameters:
file | File name.
|
line | Line number.
|
void unsynchronized_debug (const char* file, const cardinal line)
|
Debug version of unsynchronized. This will print PID, file name
and line number, followed by debug information.
Parameters:
file | File name.
|
line | Line number.
|
bool synchronizedTry_debug (const char* file, const cardinal line)
|
Debug version of synchronizedTry. This will print PID, file name
and line number, followed by debug information.
Parameters:
file | File name.
|
line | Line number.
|
void resynchronize_debug (const char* file, const cardinal line)
|
Debug version of resynchronize. This will print PID, file name
and line number, followed by debug information.
Parameters:
file | File name.
|
line | Line number.
|
- Version: 1.0
- Author: Thomas Dreibholz (Dreibholz@bigfoot.com)
- Generated: viper@odin on Fri Feb 23 12:41:26 2001, using kdoc 2.0a36.