Add volatile to spinlock variables
Otherwise the loop inside spinlock_acquire will turn into an eternal loop when optimizations have been turned on.
This commit is contained in:
@ -42,7 +42,7 @@ MXS_BEGIN_DECLS
|
|||||||
*/
|
*/
|
||||||
typedef struct spinlock
|
typedef struct spinlock
|
||||||
{
|
{
|
||||||
int lock; /*< Is the lock held? */
|
volatile int lock;/*< Is the lock held? */
|
||||||
#if SPINLOCK_PROFILE
|
#if SPINLOCK_PROFILE
|
||||||
int spins; /*< Number of spins on this lock */
|
int spins; /*< Number of spins on this lock */
|
||||||
int maxspins; /*< Max no of spins to acquire lock */
|
int maxspins; /*< Max no of spins to acquire lock */
|
||||||
|
Reference in New Issue
Block a user