Skip to content

Commit 178a626

Browse files
Change order of lock to prevent deadlock. (#368)
Resolves #367.
1 parent e6f241c commit 178a626

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/behaviortree_cpp_v3/blackboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ class Blackboard
116116
template <typename T>
117117
void set(const std::string& key, const T& value)
118118
{
119-
std::unique_lock<std::mutex> lock(mutex_);
120119
std::unique_lock<std::mutex> lock_entry(entry_mutex_);
120+
std::unique_lock<std::mutex> lock(mutex_);
121121
auto it = storage_.find(key);
122122

123123
if( auto parent = parent_bb_.lock())

0 commit comments

Comments
 (0)