The lock operation is only modified in the case of contention on a thin lock.
When a thread fails to acquire a thin lock on object
due to
contention (because thread
already owns the thin lock),
then (1) thread
acquires the
contention lock of the owning thread (
),
and (2) sets the contention bit of thread
,
then (3) checks that the lock of object
is still thin and owned by
thread
.
If the check fails, (4a) the contention bit is restored to its initial
value, the contention lock is released and the lock operation is repeated.
If the check succeeds, (4b) the tuple (
,
) is added to the linked list
of thread
, then thread
is put in the waiting state
(temporarily releasing the contention lock of thread
, while it sleeps).
Later, when thread
wakes up (because it was signaled), it releases
the re-acquired contention lock and repeats the lock operation.