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:
hujun5
2024-11-20 09:01:45 +08:00
committed by Xiang Xiao
parent e69903c939
commit 34e79f9618
10 changed files with 19 additions and 29 deletions
+1 -1
View File
@@ -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;
}