From 08221b54d0077b09fabb18dca421795301fa29ae Mon Sep 17 00:00:00 2001 From: zms123456 <85141075+zmshahaha@users.noreply.github.com> Date: Thu, 12 Sep 2024 06:03:43 +0800 Subject: [kernel][mutex] fix bug of thread exit without releasing mutex & add error check log --- src/ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ipc.c') diff --git a/src/ipc.c b/src/ipc.c index fd8e9c66bf..4cea8d8a51 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -1351,7 +1351,7 @@ static rt_err_t _rt_mutex_take(rt_mutex_t mutex, rt_int32_t timeout, int suspend if (mutex->owner == thread) { - if(mutex->hold < RT_MUTEX_HOLD_MAX) + if (mutex->hold < RT_MUTEX_HOLD_MAX) { /* it's the same thread */ mutex->hold ++; -- cgit v1.3.1