[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#6104) race condition with cancel operation

hyc@symas.com writes:
>> slapd/cancel.c sets o_abandon before o_cancel.  Thus it's possible for
>> the canceled operation to obey o_abandon before o_cancel gets set.
> Cancel is just best-effort, why not just set o_cancel before o_abandon?

Memory coherence.  Without mutex protection, the cancelled thread might
still see the o_abandon change before the o_cancel change.  And thus not
send a response, nor update info for the Cancel operation to react to.