Messages in this thread | | | Date | Tue, 21 Aug 2012 20:34:08 +0200 | From | Oleg Nesterov <> | Subject | Re: lockdep trace from posix timers |
| |
On 08/21, Oleg Nesterov wrote: > > static inline bool cmp_xchg(struct callback_head **ptr, void *old, void *new) > { > return cmpxchg(ptr, old, new) == old; > } > > int > task_work_add(struct task_struct *task, struct callback_head *twork, bool notify) > { > do { > twork->next = ACCESS_ONCE(task->task_works); > if (unlikely(twork->next == TWORK_EXITED)) > return -ESRCH; > } while (cmp_xchg(&task->task_works, twork->next, twork)); ^^^^^^^^^^^^^^^
while (!cmp_xchg(...))
Oleg.
| |