MCPcopy Create free account
hub / github.com/FastLED/FastLED / try_lock

Method try_lock

src/platforms/arm/rp/mutex_rp.cpp.hpp:91–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91bool MutexRP::try_lock() {
92 if (mSpinlock == nullptr) {
93 return false;
94 }
95
96 spin_lock_t* spinlock = static_cast<spin_lock_t*>(mSpinlock);
97
98 // Try to acquire the spinlock without blocking
99 // Use spin_try_lock_unsafe which returns true if lock acquired
100 bool acquired = spin_try_lock_unsafe(spinlock);
101
102 if (acquired) {
103 mLocked = true;
104 mOwnerCore = get_core_num();
105 }
106
107 return acquired;
108}
109
110//=============================================================================
111// RecursiveMutexRP Implementation

Callers 3

unique_lockMethod · 0.45
unique_lockClass · 0.45
FL_TEST_FILEFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected