File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ static inline bool pthread_mutex_islocked(FAR struct pthread_mutex_s *mutex)
101
101
int pthread_mutex_unlock (FAR pthread_mutex_t * mutex )
102
102
{
103
103
int ret = EPERM ;
104
+ irqstate_t flags ;
104
105
105
106
sinfo ("mutex=%p\n" , mutex );
106
107
DEBUGASSERT (mutex != NULL );
@@ -113,7 +114,7 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex)
113
114
* This all needs to be one atomic action.
114
115
*/
115
116
116
- sched_lock ();
117
+ flags = enter_critical_section ();
117
118
118
119
/* The unlock operation is only performed if the mutex is actually locked.
119
120
* EPERM *must* be returned if the mutex type is PTHREAD_MUTEX_ERRORCHECK
@@ -223,7 +224,7 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex)
223
224
}
224
225
}
225
226
226
- sched_unlock ( );
227
+ leave_critical_section ( flags );
227
228
sinfo ("Returning %d\n" , ret );
228
229
return ret ;
229
230
}
You can’t perform that action at this time.
0 commit comments