x86 spinlock trylock: make next initializer old-gcc friendly
old gcc versions are stupid with nested structs and need us to initialize .tickets.head and .tickets.tail in one go Change-Id: I0d4caf8236066e7edf4a12e3270114132ced9585
This commit is contained in:
committed by
Dominique Martinet
parent
19b02cf4ed
commit
940eeca6f5
@ -53,7 +53,10 @@ rc = __ihk_mc_spinlock_trylock_noirq(l); \
|
||||
static inline int __ihk_mc_spinlock_trylock_noirq(ihk_spinlock_t *lock)
|
||||
{
|
||||
ihk_spinlock_t cur = { .head_tail = lock->head_tail };
|
||||
ihk_spinlock_t next = { .tickets.head = cur.tickets.head, .tickets.tail = cur.tickets.tail + 2 };
|
||||
ihk_spinlock_t next = { .tickets = {
|
||||
.head = cur.tickets.head,
|
||||
.tail = cur.tickets.tail + 2
|
||||
} };
|
||||
int success;
|
||||
|
||||
if (cur.tickets.head != cur.tickets.tail) {
|
||||
|
||||
Reference in New Issue
Block a user