|
|
@@ -16,6 +16,7 @@
|
|
|
|
|
|
#include "dtoolbase.h"
|
|
|
#include "mutexImpl.h"
|
|
|
+#include "atomicAdjust.h"
|
|
|
|
|
|
/**
|
|
|
* The base class for both IStreamWrapper and OStreamWrapper, this provides
|
|
|
@@ -30,8 +31,17 @@ PUBLISHED:
|
|
|
INLINE void acquire();
|
|
|
INLINE void release();
|
|
|
|
|
|
+public:
|
|
|
+ INLINE void ref() const;
|
|
|
+ INLINE bool unref() const;
|
|
|
+
|
|
|
private:
|
|
|
MutexImpl _lock;
|
|
|
+
|
|
|
+ // This isn't really designed as a reference counted class, but it is useful
|
|
|
+ // to treat it as one when dealing with substreams created by Multifile.
|
|
|
+ mutable AtomicAdjust::Integer _ref_count = 1;
|
|
|
+
|
|
|
#ifdef SIMPLE_THREADS
|
|
|
// In the SIMPLE_THREADS case, we need to use a bool flag, because MutexImpl
|
|
|
// defines to nothing in this case--but we still need to achieve a form of
|