This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

Fork generation and pthread_once


Our pthread_once implementation has some logic in it to allow pthread_once to re-run the initialization in the child process if a fork has happened while the initialization executed in another thread.

Technically, this is compliant because pthread_once is not async-signal-safe and thus is not allowed to be called after a fork. But the whole thing still looks fairly broken to me because it is not immediately obvious that restarting an arbitrary pthread_once initialization is safe.

So do we really need the fork generation logic?

I feel like I have raised this before.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]