File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -67,23 +67,22 @@ uint32_t FreeRTOS::getTimeSinceStart() {
67
67
*/
68
68
uint32_t FreeRTOS::Semaphore::wait (std::string owner) {
69
69
ESP_LOGV (LOG_TAG, " >> wait: Semaphore waiting: %s for %s" , toString ().c_str (), owner.c_str ());
<
8000
td data-grid-cell-id="diff-07fbbb195e56760709a20d9bec35cd2d829457a11d4a9b20e8ede04cfc49a771-69-70-1" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-additionNum-bgColor, var(--diffBlob-addition-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">70
+
71
+ m_owner = owner;
70
72
71
73
if (m_usePthreads) {
72
74
pthread_mutex_lock (&m_pthread_mutex);
73
75
} else {
74
76
xSemaphoreTake (m_semaphore, portMAX_DELAY);
75
77
}
76
78
77
- m_owner = owner;
78
-
79
79
if (m_usePthreads) {
80
80
pthread_mutex_unlock (&m_pthread_mutex);
81
81
} else {
82
82
xSemaphoreGive (m_semaphore);
83
83
}
84
84
85
85
ESP_LOGV (LOG_TAG, " << wait: Semaphore released: %s" , toString ().c_str ());
86
- m_owner = std::string (" <N/A>" );
87
86
return m_value;
88
87
} // wait
89
88
@@ -93,7 +92,8 @@ FreeRTOS::Semaphore::Semaphore(std::string name) {
93
92
if (m_usePthreads) {
94
93
pthread_mutex_init (&m_pthread_mutex, nullptr );
95
94
} else {
96
- m_semaphore = xSemaphoreCreateMutex ();
95
+ m_semaphore = xSemaphoreCreateBinary ();
96
+ xSemaphoreGive (m_semaphore);
97
97
}
98
98
99
99
m_name = name;
You can’t perform that action at this time.
0 commit comments