mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:16:47 +08:00
spinlock: use spin_lock_init replace spin_initialize
reason: 1: spin_lock_init and spin_initialize have similar functionalities. 2: spin_lock and spin_unlock should be called in matching pairs. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -94,7 +94,7 @@ int pthread_spin_init(FAR pthread_spinlock_t *lock, int pshared)
|
||||
DEBUGASSERT(lock != NULL);
|
||||
if (lock != NULL)
|
||||
{
|
||||
spin_initialize(&lock->sp_lock, SP_UNLOCKED);
|
||||
spin_lock_init(&lock->sp_lock);
|
||||
lock->sp_holder = IMPOSSIBLE_THREAD;
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user