summaryrefslogtreecommitdiff
path: root/TAO/tao/Configurable_Refcount.inl
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2006-07-17 14:42:07 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2006-07-17 14:42:07 +0000
commit90e82cfdc6a1431e0de85ce4e4d4ec7c2b4a4bda (patch)
tree8d4caf5c22cd4c69e8a455cb79683d909be7122c /TAO/tao/Configurable_Refcount.inl
parent9feb4921ca05be6405be9a33c61137b829ebd925 (diff)
downloadATCD-90e82cfdc6a1431e0de85ce4e4d4ec7c2b4a4bda.tar.gz
ChangeLogTag: Mon Jul 17 14:40:43 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tao/Configurable_Refcount.inl')
-rw-r--r--TAO/tao/Configurable_Refcount.inl55
1 files changed, 55 insertions, 0 deletions
diff --git a/TAO/tao/Configurable_Refcount.inl b/TAO/tao/Configurable_Refcount.inl
new file mode 100644
index 00000000000..c885976bbc6
--- /dev/null
+++ b/TAO/tao/Configurable_Refcount.inl
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+//$Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_Configurable_Refcount::TAO_Configurable_Refcount (
+ TAO_Configurable_Refcount::Lock_Type type,
+ unsigned long value)
+ : type_ (type),
+ null_refcount_ (value),
+ mutex_refcount_ (value)
+{
+}
+
+ACE_INLINE unsigned long
+TAO_Configurable_Refcount::increment (void)
+{
+ switch(this->type_)
+ {
+ case TAO_NULL_LOCK:
+ return this->null_refcount_++;
+ case TAO_THREAD_LOCK:
+ default:
+ return this->mutex_refcount_++;
+ }
+}
+
+ACE_INLINE unsigned long
+TAO_Configurable_Refcount::decrement (void)
+{
+ switch(this->type_)
+ {
+ case TAO_NULL_LOCK:
+ return --this->null_refcount_;
+ case TAO_THREAD_LOCK:
+ default:
+ return --this->mutex_refcount_;
+ }
+}
+
+ACE_INLINE unsigned long
+TAO_Configurable_Refcount::value (void) const
+{
+ switch(this->type_)
+ {
+ case TAO_NULL_LOCK:
+ return this->null_refcount_.value ();
+ case TAO_THREAD_LOCK:
+ default:
+ return this->mutex_refcount_.value ();
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL