Panda3D
|
This class provides a locking wrapper around an arbitrary ostream pointer. More...
Public Member Functions | |
OStreamWrapper (ostream stream) | |
acquire () | |
Acquires the internal lock. | |
ostream | getOstream () |
Returns the ostream this object is wrapping. | |
release () | |
Releases the internal lock. |
This class provides a locking wrapper around an arbitrary ostream pointer.
A thread may use this class to perform an atomic seek/write operation.
OStreamWrapper | ( | ostream | stream | ) |
acquire | ( | ) | [inherited] |
Acquires the internal lock.
User code should call this to take temporary possession of the stream and perform direct I/O operations on it, for instance to make several sequential atomic reads. You may not call any of the StreamWrapper methods while the lock is held, other than release().
Use with extreme caution! This is a very low-level, non-recursive lock. You must call acquire() only once, and you must later call release() exactly once. Failing to do so may result in a hard deadlock with no available debugging features.
ostream getOstream | ( | ) |
Returns the ostream this object is wrapping.