diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-01-04 19:24:25 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-01-04 19:24:25 +0000 |
commit | 6794bc7f5b763da869879bf0e386cab3c940c1ff (patch) | |
tree | 43e4b317335e0501e59d819791a567ae6a4254ba | |
parent | 491d5ba11a6b8b7d22599d510fdc7d7a0aed9a97 (diff) | |
download | ATCD-6794bc7f5b763da869879bf0e386cab3c940c1ff.tar.gz |
*** empty log message ***
-rw-r--r-- | ChangeLog-98a | 7 | ||||
-rw-r--r-- | ace/OS.i | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog-98a b/ChangeLog-98a index eea9dd5f2f1..88b0b8c1f18 100644 --- a/ChangeLog-98a +++ b/ChangeLog-98a @@ -1,5 +1,12 @@ Sun Jan 4 10:11:53 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + * ace/OS.i (rw_trywrlock_upgrade): Temporarily comments out this + method since we need to finish implementing it correctly. + + * ace/OS.i (rw_trywrlock_upgrade): Fixed a minor bug where we + weren't releasing the lock correctly if there were competing + readers. + * apps/Gateway/Gateway/Event_Channel.cpp (put): Uncommented the code that sets the appropriate locking strategy for the Message Blocks. @@ -3355,13 +3355,15 @@ ACE_OS::rw_trywrlock_upgrade (ACE_rwlock_t *rw) #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) ACE_PTHREAD_CLEANUP_PUSH (&rw->lock_); #endif /* defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) */ +#if 0 int result = 0; if (ACE_OS::mutex_lock (&rw->lock_) == -1) result = -1; // -1 means didn't get the mutex. else if (rw->ref_count_ != 1) { - // There were other readers, so we'll have to bail out. + // There were other readers, so we'll have to bail out without + // becoming upgrading to the write lock. errno = EBUSY; result = -1; } @@ -3370,8 +3372,12 @@ ACE_OS::rw_trywrlock_upgrade (ACE_rwlock_t *rw) // ourselves ahead of all other waiting writers. rw->ref_count_ = -1; - if (result != -1) + if (result != -1 || errno == EBUSY) ACE_OS::mutex_unlock (&rw->lock_); +#else + errno = EBUSY; + return -1; +#endif /* 0 */ #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) ACE_PTHREAD_CLEANUP_POP (0); #endif /* defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) */ |