This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: setjmp() shares a single jmp_buf across all threads [fixed]
Adam Megacz writes:
>
> Ah, thank you. I've found the problem, and it revolves around this
> bizarreness in mingw:
>
> /* Mingw runtime >= v0.3 provides a magic variable that is set to non-zero
> if -mthreads option was specified, or 0 otherwise. This is to get around
> the lack of weak symbols in PE-COFF. */
>
> extern int _CRT_MT;
>
> I've simply disabled the use of mingw_thr_dtor() for now, and
> everything works nicely. Does anybody know what mingw_thr_dtor()
> does/means? To the best of my knowledge, it is in charge of
> automatically deallocating thread-local storage when a thread
> terminates
Sounds reasonable.
> (why on earth doesn't Win32 do this?)
Ask Bill!
> Since libjava never allocates more than a few bytes of TLS per thread,
> this leak shouldn't be a problem in the short-term. I'll work on a
> more elegant fix later.
I'm not sure if I understand what the problem was. Is it that gcc
and/or mingw were configured in an incorrect or incompatible way?
Andrew.