ossimlabs / ossim

Core OSSIM (Open Source Software Image Map) package including C++ code for OSSIM library, command-line applications, tests, and build system
MIT License
300 stars 142 forks source link

Ocs 2177 #124

Closed gpotts closed 7 years ago

gpotts commented 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.