Skip to content
Snippets Groups Projects
  • Martin Christoph Hierholzer's avatar
    c8f41e59
    DeviceModule: change initialValueMutex into latch · c8f41e59
    Martin Christoph Hierholzer authored
    The previous implementation using the mutex had two issues:
    
    1. The mutex was locked in a different thread than unlocked (DeviceModule constructor vs. handleException() thread). This results in undefined behaviour.
    2. The boost::shared_mutex::lock_shared() function is not an interruption point, so applications did not terminate while waiting for initial values. (boost::latch::wait() is an interruption point.)
    c8f41e59
    History
    DeviceModule: change initialValueMutex into latch
    Martin Christoph Hierholzer authored
    The previous implementation using the mutex had two issues:
    
    1. The mutex was locked in a different thread than unlocked (DeviceModule constructor vs. handleException() thread). This results in undefined behaviour.
    2. The boost::shared_mutex::lock_shared() function is not an interruption point, so applications did not terminate while waiting for initial values. (boost::latch::wait() is an interruption point.)