blob: 3b6d32a1c77cfbb31113881e9f99f99e3f802133 [file] [log] [blame]
Philipp Schraderab2f8432023-09-17 18:58:06 -07001#include "aos/ipc_lib/robust_ownership_tracker.h"
2
3#include "aos/ipc_lib/lockless_queue.h"
4
5namespace aos {
6namespace ipc_lib {
7
8bool RobustOwnershipTracker::PretendThatOwnerIsDeadForTesting(pid_t died_tid) {
9 return ipc_lib::PretendThatOwnerIsDeadForTesting(&mutex_, died_tid);
10}
11
12::std::string RobustOwnershipTracker::DebugString() const {
13 ::std::stringstream s;
14 s << "{.tid=aos_mutex(" << ::std::hex << mutex_.futex;
15
16 if (mutex_.futex != 0) {
17 s << ":";
18 if (mutex_.futex & FUTEX_OWNER_DIED) {
19 s << "FUTEX_OWNER_DIED|";
20 }
21 s << "tid=" << (mutex_.futex & FUTEX_TID_MASK);
22 }
23
24 s << "),}";
25 return s.str();
26}
27
28} // namespace ipc_lib
29} // namespace aos