Skip to content

Commit dcbcc16

Browse files
committed
fixed bug with recursive mutex
1 parent 2d5f710 commit dcbcc16

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/platform/lf_rp2040_support.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ int lf_cond_signal(lf_cond_t* cond) {
310310
}
311311

312312
int lf_cond_wait(lf_cond_t* cond) {
313-
mutex_exit(cond->mutex);
313+
lf_mutex_unlock(cond->mutex);
314314
sem_acquire_blocking(&(cond->sema));
315-
mutex_enter_blocking(cond->mutex);
315+
lf_mutex_lock(cond->mutex);
316316
return 0;
317317
}
318318

include/core/platform/lf_rp2040_support.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
#ifndef LF_SINGLE_THREADED
2424
#warning "Threaded support on rp2040 is still experimental"
2525

26-
typedef mutex_t lf_mutex_t;
26+
typedef recursive_mutex_t lf_mutex_t;
2727
typedef struct {
2828
semaphore_t sema;
29-
mutex_t* mutex;
29+
lf_mutex_t* mutex;
3030
} lf_cond_t;
3131
typedef int lf_thread_t;
3232

0 commit comments

Comments
 (0)