Added #ifdef sections around policy and implementation classes that only
work properly in multi-threaded model. git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@713 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
d04a1b1f76
commit
584959ad1c
1 changed files with 25 additions and 1 deletions
|
@ -17,7 +17,9 @@
|
||||||
#define LOKI_STRONG_PTR_H
|
#define LOKI_STRONG_PTR_H
|
||||||
|
|
||||||
#include <loki/SmartPtr.h>
|
#include <loki/SmartPtr.h>
|
||||||
//#include <loki/LockingPtr.h>
|
#if defined (LOKI_OBJECT_LEVEL_THREADING) || defined (LOKI_CLASS_LEVEL_THREADING)
|
||||||
|
#include <loki/Threads.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -410,8 +412,15 @@ private:
|
||||||
/// directly - which is why it is in a private namespace. Each instance is a
|
/// directly - which is why it is in a private namespace. Each instance is a
|
||||||
/// shared resource for all copointers, and there should be only one of these
|
/// shared resource for all copointers, and there should be only one of these
|
||||||
/// for each set of copointers. This class is small, trivial, and inline.
|
/// for each set of copointers. This class is small, trivial, and inline.
|
||||||
|
///
|
||||||
|
/// \note This class is not designed for use with a single-threaded model.
|
||||||
|
/// Tests using a single-threaded model will not run properly, but tests in a
|
||||||
|
/// multi-threaded model with either class-level-locking or object-level-locking
|
||||||
|
/// do run properly.
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#if defined (LOKI_OBJECT_LEVEL_THREADING) || defined (LOKI_CLASS_LEVEL_THREADING)
|
||||||
|
|
||||||
class LOKI_EXPORT LockableTwoRefCountInfo
|
class LOKI_EXPORT LockableTwoRefCountInfo
|
||||||
: private Loki::Private::TwoRefCountInfo
|
: private Loki::Private::TwoRefCountInfo
|
||||||
{
|
{
|
||||||
|
@ -522,6 +531,8 @@ private:
|
||||||
mutable LOKI_DEFAULT_MUTEX m_Mutex;
|
mutable LOKI_DEFAULT_MUTEX m_Mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // if object-level-locking or class-level-locking
|
||||||
|
|
||||||
} // end namespace Private
|
} // end namespace Private
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -600,8 +611,15 @@ private:
|
||||||
/// shared instance of LockableTwoRefCountInfo. It behaves very similarly to
|
/// shared instance of LockableTwoRefCountInfo. It behaves very similarly to
|
||||||
/// TwoRefCounts, except that it provides thread-safety. Some functions are
|
/// TwoRefCounts, except that it provides thread-safety. Some functions are
|
||||||
/// trivial enough to be inline, while others are implemented elsewhere.
|
/// trivial enough to be inline, while others are implemented elsewhere.
|
||||||
|
///
|
||||||
|
/// \note This class is not designed for use with a single-threaded model.
|
||||||
|
/// Tests using a single-threaded model will not run properly, but tests in a
|
||||||
|
/// multi-threaded model with either class-level-locking or object-level-locking
|
||||||
|
/// do run properly.
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#if defined (LOKI_OBJECT_LEVEL_THREADING) || defined (LOKI_CLASS_LEVEL_THREADING)
|
||||||
|
|
||||||
class LOKI_EXPORT LockableTwoRefCounts
|
class LOKI_EXPORT LockableTwoRefCounts
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
@ -667,6 +685,8 @@ private:
|
||||||
Loki::Private::LockableTwoRefCountInfo * m_counts;
|
Loki::Private::LockableTwoRefCountInfo * m_counts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // if object-level-locking or class-level-locking
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// \class TwoRefLinks
|
/// \class TwoRefLinks
|
||||||
///
|
///
|
||||||
|
@ -1481,6 +1501,10 @@ namespace std
|
||||||
#endif // end file guardian
|
#endif // end file guardian
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.8 2006/10/14 00:01:05 rich_sposato
|
||||||
|
// Added #ifdef sections around policy and implementation classes that only
|
||||||
|
// work properly in multi-threaded model.
|
||||||
|
//
|
||||||
// Revision 1.7 2006/05/20 10:25:08 syntheticpp
|
// Revision 1.7 2006/05/20 10:25:08 syntheticpp
|
||||||
// enable documentation by removing doxygen warning
|
// enable documentation by removing doxygen warning
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue