summaryrefslogtreecommitdiff
path: root/ace/Synch_T.i
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-27 16:40:29 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-27 16:40:29 +0000
commit1e01aeeb75fcbbc261dea53f350caadf5abaae50 (patch)
treeadea6bc61820a3d22b1c1b2a7cfc3bf40fcc1130 /ace/Synch_T.i
parent195740f2feb879ffaa65e59e673d4940783af957 (diff)
downloadATCD-1e01aeeb75fcbbc261dea53f350caadf5abaae50.tar.gz
ChangeLogTag: Fri Aug 27 11:29:21 1999 David L. Levine <levine@cs.wustl.edu>
Diffstat (limited to 'ace/Synch_T.i')
-rw-r--r--ace/Synch_T.i118
1 files changed, 58 insertions, 60 deletions
diff --git a/ace/Synch_T.i b/ace/Synch_T.i
index 2a14fd7a399..8a7105033cf 100644
--- a/ace/Synch_T.i
+++ b/ace/Synch_T.i
@@ -1,10 +1,32 @@
/* -*- C++ -*- */
// $Id$
-// Synch_T.i
-
#include "ace/Thread.h"
+template <class ACE_LOCK> ACE_INLINE int
+ACE_Guard<ACE_LOCK>::acquire (void)
+{
+ return this->owner_ = this->lock_->acquire ();
+}
+
+template <class ACE_LOCK> ACE_INLINE int
+ACE_Guard<ACE_LOCK>::tryacquire (void)
+{
+ return this->owner_ = this->lock_->tryacquire ();
+}
+
+template <class ACE_LOCK> ACE_INLINE int
+ACE_Guard<ACE_LOCK>::release (void)
+{
+ if (this->owner_ != -1)
+ {
+ this->owner_ = -1;
+ return this->lock_->release ();
+ }
+ else
+ return 0;
+}
+
template <class ACE_LOCK> ACE_INLINE
ACE_Guard<ACE_LOCK>::ACE_Guard (ACE_LOCK &l)
: lock_ (&l),
@@ -34,46 +56,46 @@ ACE_Guard<ACE_LOCK>::~ACE_Guard (void)
}
template <class ACE_LOCK> ACE_INLINE int
-ACE_Guard<ACE_LOCK>::acquire (void)
+ACE_Guard<ACE_LOCK>::locked (void)
{
- return this->owner_ = this->lock_->acquire ();
+ return this->owner_ != -1;
}
template <class ACE_LOCK> ACE_INLINE int
-ACE_Guard<ACE_LOCK>::tryacquire (void)
+ACE_Guard<ACE_LOCK>::remove (void)
{
- return this->owner_ = this->lock_->tryacquire ();
+ return this->lock_->remove ();
+}
+
+template <class ACE_LOCK> ACE_INLINE
+ACE_Write_Guard<ACE_LOCK>::ACE_Write_Guard (ACE_LOCK &m)
+ : ACE_Guard<ACE_LOCK> (&m)
+{
+ this->acquire_write ();
}
template <class ACE_LOCK> ACE_INLINE int
-ACE_Guard<ACE_LOCK>::release (void)
+ACE_Write_Guard<ACE_LOCK>::acquire_write (void)
{
- if (this->owner_ != -1)
- {
- this->owner_ = -1;
- return this->lock_->release ();
- }
- else
- return 0;
+ return this->owner_ = this->lock_->acquire_write ();
}
template <class ACE_LOCK> ACE_INLINE int
-ACE_Guard<ACE_LOCK>::locked (void)
+ACE_Write_Guard<ACE_LOCK>::acquire (void)
{
- return this->owner_ != -1;
+ return this->owner_ = this->lock_->acquire_write ();
}
template <class ACE_LOCK> ACE_INLINE int
-ACE_Guard<ACE_LOCK>::remove (void)
+ACE_Write_Guard<ACE_LOCK>::tryacquire_write (void)
{
- return this->lock_->remove ();
+ return this->owner_ = this->lock_->tryacquire_write ();
}
-template <class ACE_LOCK> ACE_INLINE
-ACE_Write_Guard<ACE_LOCK>::ACE_Write_Guard (ACE_LOCK &m)
- : ACE_Guard<ACE_LOCK> (&m)
+template <class ACE_LOCK> ACE_INLINE int
+ACE_Write_Guard<ACE_LOCK>::tryacquire (void)
{
- this->acquire_write ();
+ return this->owner_ = this->lock_->tryacquire_write ();
}
template <class ACE_LOCK> ACE_INLINE
@@ -88,38 +110,38 @@ ACE_Write_Guard<ACE_LOCK>::ACE_Write_Guard (ACE_LOCK &m,
}
template <class ACE_LOCK> ACE_INLINE int
-ACE_Write_Guard<ACE_LOCK>::acquire_write (void)
+ACE_Read_Guard<ACE_LOCK>::acquire_read (void)
{
- return this->owner_ = this->lock_->acquire_write ();
+ return this->owner_ = this->lock_->acquire_read ();
}
-template <class ACE_LOCK> ACE_INLINE int
-ACE_Write_Guard<ACE_LOCK>::acquire (void)
+template <class ACE_LOCK> ACE_INLINE int
+ACE_Read_Guard<ACE_LOCK>::acquire (void)
{
- return this->owner_ = this->lock_->acquire_write ();
+ return this->owner_ = this->lock_->acquire_read ();
}
-template <class ACE_LOCK> ACE_INLINE int
-ACE_Write_Guard<ACE_LOCK>::tryacquire_write (void)
+template <class ACE_LOCK> ACE_INLINE int
+ACE_Read_Guard<ACE_LOCK>::tryacquire_read (void)
{
- return this->owner_ = this->lock_->tryacquire_write ();
+ return this->owner_ = this->lock_->tryacquire_read ();
}
-template <class ACE_LOCK> ACE_INLINE int
-ACE_Write_Guard<ACE_LOCK>::tryacquire (void)
+template <class ACE_LOCK> ACE_INLINE int
+ACE_Read_Guard<ACE_LOCK>::tryacquire (void)
{
- return this->owner_ = this->lock_->tryacquire_write ();
+ return this->owner_ = this->lock_->tryacquire_read ();
}
-template <class ACE_LOCK> ACE_INLINE
+template <class ACE_LOCK> ACE_INLINE
ACE_Read_Guard<ACE_LOCK>::ACE_Read_Guard (ACE_LOCK &m)
: ACE_Guard<ACE_LOCK> (&m)
{
this->acquire_read ();
}
-template <class ACE_LOCK> ACE_INLINE
-ACE_Read_Guard<ACE_LOCK>::ACE_Read_Guard (ACE_LOCK &m,
+template <class ACE_LOCK> ACE_INLINE
+ACE_Read_Guard<ACE_LOCK>::ACE_Read_Guard (ACE_LOCK &m,
int block)
: ACE_Guard<ACE_LOCK> (&m)
{
@@ -129,30 +151,6 @@ ACE_Read_Guard<ACE_LOCK>::ACE_Read_Guard (ACE_LOCK &m,
this->tryacquire_read ();
}
-template <class ACE_LOCK> ACE_INLINE int
-ACE_Read_Guard<ACE_LOCK>::acquire_read (void)
-{
- return this->owner_ = this->lock_->acquire_read ();
-}
-
-template <class ACE_LOCK> ACE_INLINE int
-ACE_Read_Guard<ACE_LOCK>::acquire (void)
-{
- return this->owner_ = this->lock_->acquire_read ();
-}
-
-template <class ACE_LOCK> ACE_INLINE int
-ACE_Read_Guard<ACE_LOCK>::tryacquire_read (void)
-{
- return this->owner_ = this->lock_->tryacquire_read ();
-}
-
-template <class ACE_LOCK> ACE_INLINE int
-ACE_Read_Guard<ACE_LOCK>::tryacquire (void)
-{
- return this->owner_ = this->lock_->tryacquire_read ();
-}
-
template <class ACE_LOCKING_MECHANISM> ACE_INLINE
ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::ACE_Lock_Adapter (ACE_LOCKING_MECHANISM &lock)
: lock_ (&lock),