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

Fix TSA warnings when building with clang thread analysis. #877

Merged
merged 1 commit into from
Oct 8, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <mutex>
#include <string>

#include "rcpputils/thread_safety_annotations.hpp"

#include "rosbag2_cpp/cache/message_cache_circular_buffer.hpp"
#include "rosbag2_cpp/cache/message_cache_interface.hpp"
#include "rosbag2_cpp/cache/cache_buffer_interface.hpp"
Expand Down Expand Up @@ -56,10 +58,11 @@ class ROSBAG2_CPP_PUBLIC CircularMessageCache
/// Get current buffer to consume.
/// Locks consumer_buffer and swap_buffers until release_consumer_buffer is called.
/// This may be repeatedly empty if `swap_buffers` has not been called.
std::shared_ptr<CacheBufferInterface> consumer_buffer() override;
std::shared_ptr<CacheBufferInterface>
consumer_buffer() override RCPPUTILS_TSA_ACQUIRE(consumer_buffer_mutex_);

/// Unlock access to the consumer buffer.
void release_consumer_buffer() override;
void release_consumer_buffer() override RCPPUTILS_TSA_RELEASE(consumer_buffer_mutex_);

/// Swap the primary and secondary buffer before consumption.
/// NOTE: If swap_buffers is called again before consuming via consumer_buffer,
Expand Down