Skip to content

Commit bf79555

Browse files
committed
minor changes
1 parent e5e60db commit bf79555

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

include/behaviortree_cpp/blackboard.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,15 @@ class Blackboard
255255
storage_.clear();
256256
}
257257

258+
[[deprecated("Use getAnyRead or getAnyWrite to access safely an Entry")]]
259+
std::recursive_mutex& entryMutex() const
260+
{
261+
return entry_mutex_;
262+
}
263+
258264
private:
259265
mutable std::mutex mutex_;
266+
mutable std::recursive_mutex entry_mutex_;
260267
std::unordered_map<std::string, std::unique_ptr<Entry>> storage_;
261268
std::weak_ptr<Blackboard> parent_bb_;
262269
std::unordered_map<std::string, std::string> internal_to_external_;

include/behaviortree_cpp/tree_node.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class TreeNode
243243
/**
244244
* @brief getPortAny should be used when:
245245
*
246-
* - your port contains an object with reference semantic (raw or smart pointer)
246+
* - your port contains an object with reference semantic (usually a smart pointer)
247247
* - you want to modify the object we are pointing to.
248248
* - you are concerned about thread-safety.
249249
*
@@ -263,7 +263,7 @@ class TreeNode
263263
*
264264
* It is important to destroy the object AnyWriteRef, to release the lock.
265265
*
266-
* NOTE: this method doesn't work if the port contains a static string, instead
266+
* NOTE: this method doesn't work, if the port contains a static string, instead
267267
* of a blackboard pointer.
268268
*
269269
* @param key the identifier of the port.
@@ -425,8 +425,8 @@ inline Result TreeNode::getInput(const std::string& key, T& destination) const
425425
if (auto any_ref = config_.blackboard->getAnyRead(std::string(remapped_key)))
426426
{
427427
auto val = any_ref.get();
428-
if(!val->empty())
429-
{
428+
if(!val->empty())
429+
{
430430
if (!std::is_same_v<T, std::string> &&
431431
val->type() == typeid(std::string))
432432
{

0 commit comments

Comments
 (0)