There was rather huge commit-git into nptl/glibc:
http://sourceware.org/git/?p=glibc.git;a=commit;h=e51deae7f6ba2e490d5faeb8fbf4eeb32ae8f1ee
by Ulrich Drepper and Jakub Jelinek @ 2007
I interested in the change to lll_lock/lll_unlock
In SMP code, lll_unlock was modified to
+# define __lll_unlock_asm "cmpl $0, %%gs:%P3\n\t" \
+ "je 0f\n\t" \
+ "lock\n" \
+ "0:\tsubl $1,%0\n\t"
where $0
is the futex address Zero and %P3
is MULTIPLE_THREADS_OFFSET constant.
So, What is stored at $gs:MULTIPLE_THREADS_OFFSET
(aka $gs:(offsetof (tcbhead_t, multiple_threads))
? How this value is changed in the lifetime of program?