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

Method lock

src/platforms/esp/32/mutex_esp32.cpp.hpp:49–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void MutexESP32::lock() {
50 FL_ASSERT(mHandle != nullptr, "MutexESP32::lock() called on null mutex");
51
52 SemaphoreHandle_t handle = static_cast<SemaphoreHandle_t>(mHandle);
53
54 // Block indefinitely waiting for the mutex
55 BaseType_t result = xSemaphoreTake(handle, portMAX_DELAY);
56
57 FL_ASSERT(result == pdTRUE, "MutexESP32::lock() failed to acquire mutex");
58}
59
60void MutexESP32::unlock() {
61 FL_ASSERT(mHandle != nullptr, "MutexESP32::unlock() called on null mutex");

Callers 2

waitMethod · 0.45
wait_forMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected