19#include "pw_sync/lock_annotations.h"
20#include "pw_thread/config.h"
21#include "pw_thread/thread.h"
63#if PW_THREAD_CHECKER_RUNTIME_ASSERT_ENABLED
66 PW_ASSERT(pw::this_thread::get_id() == self_);
101#if PW_THREAD_CHECKER_RUNTIME_ASSERT_ENABLED
109#if PW_THREAD_CHECKER_RUNTIME_ASSERT_ENABLED
110 Thread::id stored_id = thread_id_.load(std::memory_order_acquire);
114 const Thread::id current_id = pw::this_thread::get_id();
120 if (thread_id_.compare_exchange_strong(
121 uninitialized_id, current_id, std::memory_order_acq_rel)) {
123 stored_id = current_id;
127 stored_id = uninitialized_id;
133 PW_ASSERT(pw::this_thread::get_id() == stored_id);
139#if PW_THREAD_CHECKER_RUNTIME_ASSERT_ENABLED
140 std::atomic<Thread::id> thread_id_;
#define PW_LOCKABLE(name)
Definition: lock_annotations.h:208
#define PW_EXCLUSIVE_LOCK_FUNCTION(...)
Definition: lock_annotations.h:230
#define PW_UNLOCK_FUNCTION(...)
Definition: lock_annotations.h:247
::pw::thread::backend::NativeId id
Definition: thread.h:90
The Pigweed namespace.
Definition: alignment.h:27