Philipp Schrader | ab2f843 | 2023-09-17 18:58:06 -0700 | [diff] [blame^] | 1 | #include "aos/ipc_lib/robust_ownership_tracker.h" |
| 2 | |
| 3 | #include "aos/ipc_lib/lockless_queue.h" |
| 4 | |
| 5 | namespace aos { |
| 6 | namespace ipc_lib { |
| 7 | |
| 8 | bool 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 |