MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / indirect_lock

Function indirect_lock

thread/thread.cpp:1507–1519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1505 }
1506
1507 template<typename T, typename PT = T*> inline
1508 T* indirect_lock(volatile PT* ppt, T* end)
1509 {
1510 again:
1511 T* x = *ppt;
1512 if (!x || x == end)
1513 return nullptr;
1514 x->lock.lock();
1515 if (x == *ppt)
1516 return x;
1517 x->lock.unlock();
1518 goto again;
1519 }
1520 inline thread* indirect_lock(thread** ppt)
1521 {
1522 return indirect_lock<thread>(ppt, nullptr);

Callers 1

ScopedLockHeadMethod · 0.85

Calls 2

lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected