| 81 | static auto umtxStorage = createGlobalObject<UmtxStorage>(); |
| 82 | |
| 83 | std::pair<const UmtxKey, UmtxCond> *UmtxChain::enqueue(UmtxKey &key, |
| 84 | Thread *thr) { |
| 85 | if (!spare_queue.empty()) { |
| 86 | auto node = spare_queue.extract(spare_queue.begin()); |
| 87 | node.key() = key; |
| 88 | node.mapped().thr = thr; |
| 89 | return &*sleep_queue.insert(std::move(node)); |
| 90 | } |
| 91 | return &*sleep_queue.emplace(key, thr); |
| 92 | } |
| 93 | |
| 94 | void UmtxChain::erase(std::pair<const UmtxKey, UmtxCond> *obj) { |
| 95 | for (auto [it, e] = sleep_queue.equal_range(obj->first); it != e; it++) { |
no test coverage detected