sched/semaphore/spinlock.c: Add memory barrier operations in spin_unlock()

In ARM document regarding memory barrires, SP_DMB() must be issued
before changing a spinlock state to SP_UNLOCKED. However, we found
that SP_DSB() is also needed to ensure that spin_unlock() works
correctly for network streaming aging test.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2017-12-21 17:26:36 +09:00
parent 5414d68161
commit e1f71f988b

View File

@ -165,8 +165,9 @@ void spin_unlock(FAR volatile spinlock_t *lock)
sched_note_spinunlock(this_task(), lock);
#endif
*lock = SP_UNLOCKED;
SP_DMB();
*lock = SP_UNLOCKED;
SP_DSB();
}
#endif