summaryrefslogtreecommitdiff
path: root/ace/Synch.i
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2000-09-11 18:21:53 +0000
committerSteve Huston <shuston@riverace.com>2000-09-11 18:21:53 +0000
commit53c3012ea338a0298ce8870bb27453fa91d6aa87 (patch)
treefd645db7ebf5ba5552b55eb49349859ee637d82d /ace/Synch.i
parentd27eb2ae64f4dd6d0080558a738167da0cdfabd6 (diff)
downloadATCD-53c3012ea338a0298ce8870bb27453fa91d6aa87.tar.gz
ChangeLogTag:Mon Sep 11 12:57:31 2000 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ace/Synch.i')
-rw-r--r--ace/Synch.i79
1 files changed, 79 insertions, 0 deletions
diff --git a/ace/Synch.i b/ace/Synch.i
index 998b8e3db25..79b0f9ed2bf 100644
--- a/ace/Synch.i
+++ b/ace/Synch.i
@@ -28,6 +28,13 @@ ACE_File_Lock::tryacquire_write (short whence, off_t start, off_t len)
}
ACE_INLINE int
+ACE_File_Lock::tryacquire_write_upgrade (short whence, off_t start, off_t len)
+{
+// ACE_TRACE ("ACE_File_Lock::tryacquire_write_upgrade");
+ return ACE_OS::flock_trywrlock (&this->lock_, whence, start, len);
+}
+
+ACE_INLINE int
ACE_File_Lock::tryacquire (short whence, off_t start, off_t len)
{
// ACE_TRACE ("ACE_File_Lock::tryacquire");
@@ -142,6 +149,13 @@ ACE_RW_Mutex::tryacquire_write (void)
}
ACE_INLINE int
+ACE_RW_Mutex::tryacquire_write_upgrade (void)
+{
+// ACE_TRACE ("ACE_RW_Mutex::tryacquire_write_upgrade");
+ return ACE_OS::rw_trywrlock_upgrade (&this->lock_);
+}
+
+ACE_INLINE int
ACE_RW_Mutex::tryacquire (void)
{
// ACE_TRACE ("ACE_RW_Mutex::tryacquire");
@@ -220,6 +234,13 @@ ACE_Mutex::tryacquire_write (void)
}
ACE_INLINE int
+ACE_Mutex::tryacquire_write_upgrade (void)
+{
+// ACE_TRACE ("ACE_Mutex::tryacquire_write_upgrade");
+ return 0;
+}
+
+ACE_INLINE int
ACE_Mutex::acquire (void)
{
// ACE_TRACE ("ACE_Mutex::acquire");
@@ -389,6 +410,16 @@ ACE_Semaphore::tryacquire_write (void)
return this->tryacquire ();
}
+// This is only here to make the <ACE_Semaphore>
+// interface consistent with the other synchronization APIs.
+// Assumes the caller has already acquired the semaphore using one of
+// the above calls, and returns 0 (success) always.
+ACE_INLINE int
+ACE_Semaphore::tryacquire_write_upgrade (void)
+{
+ return 0;
+}
+
#if defined (ACE_WIN32) || defined (ACE_HAS_POSIX_SEM) || defined (ACE_PSOS)
ACE_INLINE const ACE_mutex_t &
ACE_Process_Mutex::lock (void) const
@@ -445,6 +476,16 @@ ACE_Process_Semaphore::tryacquire_write (void)
return this->tryacquire ();
}
+// This is only here to make the <ACE_Process_Semaphore>
+// interface consistent with the other synchronization APIs.
+// Assumes the caller has already acquired the semaphore using one of
+// the above calls, and returns 0 (success) always.
+ACE_INLINE int
+ACE_Process_Semaphore::tryacquire_write_upgrade (void)
+{
+ return 0;
+}
+
// Null ACE_Semaphore implementation
ACE_INLINE
@@ -510,6 +551,12 @@ ACE_Null_Semaphore::tryacquire_write (void)
}
ACE_INLINE int
+ACE_Null_Semaphore::tryacquire_write_upgrade (void)
+{
+ return 0;
+}
+
+ACE_INLINE int
ACE_Null_Semaphore::acquire_read (void)
{
return 0;
@@ -564,6 +611,13 @@ ACE_Thread_Mutex::tryacquire_write (void)
}
ACE_INLINE int
+ACE_Thread_Mutex::tryacquire_write_upgrade (void)
+{
+// ACE_TRACE ("ACE_Thread_Mutex::tryacquire_write_upgrade");
+ return 0;
+}
+
+ACE_INLINE int
ACE_Thread_Mutex::acquire (void)
{
// ACE_TRACE ("ACE_Thread_Mutex::acquire");
@@ -753,6 +807,12 @@ ACE_Recursive_Thread_Mutex::tryacquire_write (void)
return this->tryacquire ();
}
+ACE_INLINE int
+ACE_Recursive_Thread_Mutex::tryacquire_write_upgrade (void)
+{
+ return 0;
+}
+
#endif /* ACE_HAS_THREADS */
// Explicitly destroy the mutex.
@@ -811,6 +871,12 @@ ACE_Process_Mutex::tryacquire_write (void)
return this->lock_.tryacquire_write ();
}
+ACE_INLINE int
+ACE_Process_Mutex::tryacquire_write_upgrade (void)
+{
+ return 0;
+}
+
// Explicitly destroy the mutex.
ACE_INLINE int
ACE_RW_Process_Mutex::remove (void)
@@ -867,6 +933,13 @@ ACE_RW_Process_Mutex::tryacquire_write (void)
return this->lock_.tryacquire_write ();
}
+// Conditionally upgrade a lock (i.e., won't block).
+ACE_INLINE int
+ACE_RW_Process_Mutex::tryacquire_write_upgrade (void)
+{
+ return this->lock_.tryacquire_write_upgrade ();
+}
+
ACE_INLINE const ACE_File_Lock &
ACE_RW_Process_Mutex::lock (void) const
{
@@ -944,6 +1017,12 @@ ACE_Null_Mutex::tryacquire_write (void)
}
ACE_INLINE int
+ACE_Null_Mutex::tryacquire_write_upgrade (void)
+{
+ return 0;
+}
+
+ACE_INLINE int
ACE_Null_Mutex::acquire_read (void)
{
return 0;