Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark up the message_cache with TSA annotations. #946

Merged
merged 1 commit into from
Jan 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions rosbag2_cpp/include/rosbag2_cpp/cache/message_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <string>
#include <vector>

#include "rcpputils/thread_safety_annotations.hpp"

#include "rosbag2_cpp/cache/message_cache_buffer.hpp"
#include "rosbag2_cpp/cache/message_cache_interface.hpp"
#include "rosbag2_cpp/cache/cache_buffer_interface.hpp"
Expand Down Expand Up @@ -78,10 +80,11 @@ class ROSBAG2_CPP_PUBLIC MessageCache

/// Gets a consumer buffer.
/// In this greedy implementation, swap buffers before providing the buffer.
std::shared_ptr<CacheBufferInterface> get_consumer_buffer() override;
std::shared_ptr<CacheBufferInterface>
get_consumer_buffer() override RCPPUTILS_TSA_ACQUIRE(consumer_buffer_mutex_);

/// \brief Signals that tne consumer is done consuming, unlocking the buffer so it may be swapped.
void release_consumer_buffer() override;
/// \brief Signals that the consumer is done consuming, unlocking the buffer so it may be swapped.
void release_consumer_buffer() override RCPPUTILS_TSA_RELEASE(consumer_buffer_mutex_);

/// \brief Blocks current thread and going to wait on condition variable until notify_data_ready
/// will be called.
Expand Down