]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/SGReferenced.hxx
Merge branch 'topic/gcintersect' into next
[simgear.git] / simgear / structure / SGReferenced.hxx
index 003536a39fd542191e36819c0ee62c1212ba4414..6bce1eb82bd83da9e4fce1d88e37c414340baf91 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  */
 
 #ifndef SGReferenced_HXX
 #define SGReferenced_HXX
+#define USE_OPENTHREADS_ATOMIC
+
+#ifndef USE_OPENTHREADS_ATOMIC
+#include "SGAtomic.hxx"
+#else
+#include <OpenThreads/Atomic>
+#endif
 
 /// Base class for all reference counted SimGear objects
 /// Classes derived from this one are meant to be managed with
@@ -47,7 +54,11 @@ public:
   { if (ref) return 1u < ref->_refcount; else return false; }
 
 private:
-  mutable unsigned _refcount;
+#ifndef USE_OPENTHREADS_ATOMIC
+  mutable SGAtomic _refcount;
+#else
+  mutable OpenThreads::Atomic _refcount;
+#endif
 };
 
 #endif