Closed gpotts closed 7 years ago
Hello Chris:
That is actually a lambda expression that is returning false. The m_waitCondifitonal second argument is a lambda function.
Take care
Garrett
On Sep 18, 2017, at 4:15 PM, Chris Dowin notifications@github.com wrote: @cdowin commented on this pull request. In include/ossim/base/RWLock.h https://github.com/ossimlabs/ossim/pull/124#discussion_r139528033: } template <> void RWLock::lockWrite(){ int expected = 0; if(!m_refCounter.compare_exchange_strong(expected, MIN_INT, std::memory_order_acquire, std::memory_order_relaxed)){ expected = 0; std::unique_lock lk(m_waitMutex); m_waitConditional.wait(lk, [this,&expected] { if(!m_refCounter.compare_exchange_strong(expected, MIN_INT, std::memory_order_acquire, std::memory_order_relaxed)){ expected = 0; return false; The lockWrite() method is declared as 'void', but we have a return - is this expected? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ossimlabs/ossim/pull/124#pullrequestreview-63473472, or mute the thread https://github.com/notifications/unsubscribe-auth/ACL9v4b4q3tYDpomaGhAdRepTBJpv8Lyks5sjs9OgaJpZM4PbVeT.
On Sep 18, 2017, at 4:15 PM, Chris Dowin notifications@github.com wrote:
@cdowin commented on this pull request.
In include/ossim/base/RWLock.h https://github.com/ossimlabs/ossim/pull/124#discussion_r139528033:
} template <> void RWLock::lockWrite(){ int expected = 0; if(!m_refCounter.compare_exchange_strong(expected, MIN_INT, std::memory_order_acquire, std::memory_order_relaxed)){ expected = 0; std::unique_lock lk(m_waitMutex); m_waitConditional.wait(lk, [this,&expected] { if(!m_refCounter.compare_exchange_strong(expected, MIN_INT, std::memory_order_acquire, std::memory_order_relaxed)){ expected = 0; return false; The lockWrite() method is declared as 'void', but we have a return - is this expected?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ossimlabs/ossim/pull/124#pullrequestreview-63473472, or mute the thread https://github.com/notifications/unsubscribe-auth/ACL9v4b4q3tYDpomaGhAdRepTBJpv8Lyks5sjs9OgaJpZM4PbVeT.
Hello Chris:
That is actually a lambda expression that is returning false. The m_waitCondifitonal second argument is a lambda function.
Take care
Garrett