Check whether the relationship is auto terminated
| 112 | |
| 113 | // Check whether the relationship is auto terminated |
| 114 | bool Connectable::isAutoTerminated(const core::Relationship &relationship) { |
| 115 | // if we are running we do not need a lock since the function to change relationships_ ( setSupportedRelationships) |
| 116 | // cannot be executed while we are running |
| 117 | const bool isConnectableRunning = isRunning(); |
| 118 | |
| 119 | const auto conditionalLock = isConnectableRunning ? std::unique_lock<std::mutex>() : std::unique_lock<std::mutex>(relationship_mutex_); |
| 120 | |
| 121 | const auto &it = auto_terminated_relationships_.find(relationship.getName()); |
| 122 | if (it != auto_terminated_relationships_.end()) { |
| 123 | return true; |
| 124 | } else { |
| 125 | return false; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | void Connectable::waitForWork(uint64_t timeoutMs) { |
| 130 | has_work_.store(isWorkAvailable()); |
no test coverage detected