diff options
Diffstat (limited to 'cpp/include/IceUtil/Monitor.h')
-rw-r--r-- | cpp/include/IceUtil/Monitor.h | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/cpp/include/IceUtil/Monitor.h b/cpp/include/IceUtil/Monitor.h index 2e9fd0e456f..e64830e0979 100644 --- a/cpp/include/IceUtil/Monitor.h +++ b/cpp/include/IceUtil/Monitor.h @@ -89,11 +89,11 @@ IceUtil::Monitor<T>::lock() const _mutex.lock(); if(_mutex.willUnlock()) { - // - // On the first mutex acquisition reset the number pending - // notifications. - // - _nnotify = 0; + // + // On the first mutex acquisition reset the number pending + // notifications. + // + _nnotify = 0; } } @@ -102,10 +102,10 @@ IceUtil::Monitor<T>::unlock() const { if(_mutex.willUnlock()) { - // - // Perform any pending notifications. - // - notifyImpl(_nnotify); + // + // Perform any pending notifications. + // + notifyImpl(_nnotify); } _mutex.unlock(); @@ -113,10 +113,10 @@ IceUtil::Monitor<T>::unlock() const int nnotify = _nnotify; if(_mutex.unlock()) { - // - // Perform any pending notifications. - // - notifyImpl(nnotify); + // + // Perform any pending notifications. + // + notifyImpl(nnotify); } */ } @@ -127,11 +127,11 @@ IceUtil::Monitor<T>::tryLock() const bool result = _mutex.tryLock(); if(result && _mutex.willUnlock()) { - // - // On the first mutex acquisition reset the number pending - // notifications. - // - _nnotify = 0; + // + // On the first mutex acquisition reset the number pending + // notifications. + // + _nnotify = 0; } return result; } @@ -149,15 +149,15 @@ IceUtil::Monitor<T>::wait() const // try { - _cond.waitImpl(_mutex); - // - // Reset the nnotify count once wait() returns. - // + _cond.waitImpl(_mutex); + // + // Reset the nnotify count once wait() returns. + // } catch(...) { - _nnotify = 0; - throw; + _nnotify = 0; + throw; } _nnotify = 0; @@ -177,16 +177,16 @@ IceUtil::Monitor<T>::timedWait(const Time& timeout) const // try { - rc = _cond.timedWaitImpl(_mutex, timeout); + rc = _cond.timedWaitImpl(_mutex, timeout); - // - // Reset the nnotify count once wait() returns. - // + // + // Reset the nnotify count once wait() returns. + // } catch(...) { - _nnotify = 0; - throw; + _nnotify = 0; + throw; } _nnotify = 0; @@ -202,7 +202,7 @@ IceUtil::Monitor<T>::notify() // if(_nnotify != -1) { - ++_nnotify; + ++_nnotify; } } @@ -224,25 +224,25 @@ IceUtil::Monitor<T>::notifyImpl(int nnotify) const // if(nnotify != 0) { - // - // -1 means notifyAll. - // - if(nnotify == -1) - { - _cond.broadcast(); - return; - } - else - { - // - // Otherwise notify n times. - // - while(nnotify > 0) - { - _cond.signal(); - --nnotify; - } - } + // + // -1 means notifyAll. + // + if(nnotify == -1) + { + _cond.broadcast(); + return; + } + else + { + // + // Otherwise notify n times. + // + while(nnotify > 0) + { + _cond.signal(); + --nnotify; + } + } } } |