On Mon, Nov 18, 2013 at 04:22:06PM +0100, Samuel Thibault wrote: > Richard Braun, le Sun 17 Nov 2013 17:13:23 +0100, a écrit : > > Two resources are still recycled: the internal pthread structure > > (because it makes ID allocation easy), and thread local storage (TLS) > > because that's where the reply port is stored, and it didn't seem > > convenient to call _dl_deallocate_tls in sysdeps code. > > Just realizing: we *have* to reset TLS, at least by using > _dl_allocate_tls_init, so that newer threads get the initial values for > TLS data.
"Recycled" may not be the proper word here : libpthread defers the release of TLS, as it's currently done, no change here. Calling _dl_allocate_tls is done unconditionnally on thread creation. -- Richard Braun