OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TStaticSync< T > Class Template Reference

TStaticSync provides a system-independent interface to build sets of classes that act somewhat like monitors, i.e., classes in which only one member function can execute at any one time regardless of which instance it is being called on. More...

#include <owl/thread.h>

Classes

class  TLock
 

Protected Types

typedef TLock Lock
 For compatibility with old T-less typename.
 

Protected Member Functions

 TStaticSync ()
 
 TStaticSync (const TStaticSync< T > &)
 
const TStaticSync< T > & operator= (const TStaticSync< T > &)
 
 ~TStaticSync ()
 

Friends

class TLock
 

Detailed Description

template<class T>
class owl::TStaticSync< T >

TStaticSync provides a system-independent interface to build sets of classes that act somewhat like monitors, i.e., classes in which only one member function can execute at any one time regardless of which instance it is being called on.

TStaticSync uses TCriticalSection, so it is portable to all platforms that TCriticalSection has been ported to. Example

class ThreadSafe : private TStaticSync<ThreadSafe>
{
public:
void f();
void g();
private:
static int i;
};
void ThreadSafe::f()
{
if (i == 2)
i = 3;
}
void ThreadSafe::g()
{
if (i == 3)
i = 2;
}
TStaticSync provides a system-independent interface to build sets of classes that act somewhat like m...
Definition thread.h:512
friend class TLock
Definition thread.h:524

Definition at line 512 of file thread.h.

Member Typedef Documentation

◆ Lock

template<class T >
typedef TLock owl::TStaticSync< T >::Lock
protected

For compatibility with old T-less typename.

Definition at line 525 of file thread.h.

Constructor & Destructor Documentation

◆ TStaticSync() [1/2]

template<class T >
owl::TStaticSync< T >::TStaticSync ( )
inlineprotected

Definition at line 1363 of file thread.h.

◆ TStaticSync() [2/2]

template<class T >
owl::TStaticSync< T >::TStaticSync ( const TStaticSync< T > & )
inlineprotected

Definition at line 1369 of file thread.h.

◆ ~TStaticSync()

template<class T >
owl::TStaticSync< T >::~TStaticSync ( )
inlineprotected

Definition at line 1386 of file thread.h.

Member Function Documentation

◆ operator=()

template<class T >
const TStaticSync< T > & owl::TStaticSync< T >::operator= ( const TStaticSync< T > & )
inlineprotected

Definition at line 1378 of file thread.h.

Friends And Related Symbol Documentation

◆ TLock

template<class T >
friend class TLock
friend

Definition at line 524 of file thread.h.


The documentation for this class was generated from the following file: