Skip to content
Commit e9f81c26 authored by Florian Weimer's avatar Florian Weimer
Browse files

nptl: Add one more barrier to nptl/tst-create1



Without the bar_ctor_finish barrier, it was possible that thread2
re-locked user_lock before ctor had a chance to lock it.  ctor then
blocked in its locking operation, xdlopen from the main thread
did not return, and thread2 was stuck waiting in bar_dtor:

thread 1: started.
thread 2: started.
thread 2: locked user_lock.
constructor started: 0.
thread 1: in ctor: started.
thread 3: started.
thread 3: done.
thread 2: unlocked user_lock.
thread 2: locked user_lock.

Fixes the test in commit 83b53232
("elf: Avoid deadlock between pthread_create and ctors [BZ #28357]").

Reviewed-by: default avatarSzabolcs Nagy <szabolcs.nagy@arm.com>
(cherry picked from commit 5cc33856)
parent 387bff63
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment