Skip to content
Snippets Groups Projects
Commit 294e8379 authored by Ilya Verbin's avatar Ilya Verbin Committed by Vladimir Davydov
Browse files

core: fix potential misorder of latch waiters

Currently the latch doesn't guarantee the order in which it is acquired
by fibers, which requested it. E.g. it is possible to wake up spuriously
a fiber which is yielding in the latch_lock, it will be removed from
l->queue by fiber_make_ready, then it will be inserted to l->queue
again, but for this time, to the head of the list instead of its
original place in the queue.

Fix this by using latch_waiter structure, which is linked into l->queue.

Part of #7166

@TarantoolBot document
Title: Update box_latch_lock description
Since: 2.11

Add "Locks are acquired in the strict order as they were requested." to
the box_latch_lock description in C API reference - Module latch.
parent 15b823f0
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment