This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
The alternative would be, inside the mutex:
if (__gthread_active < 0) { __gthread_active = 0; __gthrw_(pthread_once) (...); }
and then, instead of "__gthread_active++":
else __gthread_active = 0;
On second thoughts, I don't think this is safe. The first test in my patch
if (__gthread_active < 0)
is not protected to avoid taking a lock on the main code path so __gthread_active must never be 0 when the program is threaded.
-- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |