[ovs-dev] [PATCH 2/2] ovs_threads: Avoid running pthread destructors from main thread exit.

Ben Pfaff blp at nicira.com
Wed Apr 15 04:05:06 UTC 2015


On Tue, Apr 07, 2015 at 06:06:48PM -0700, Gurucharan Shetty wrote:
> Windows uses pthreads-win32 library to provide the Linux pthread
> functionality. It is observed that when the main thread calls
> a pthread destructor after it exits, undefined behavior is seen
> (e.g., junk values in data).
> 
> To avoid this, this commit de-registers the thread destructor
> when the main thread exits (via the atexit handler).
> 
> Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>

Thank you for finding the problem.  Would you mind citing that email you
found that claims that we're doing something wrong?  I don't understand
it, but maybe someone else reading it would, and it'd be nice to get
feedback.

Why does test_atomic_main() now need to call fatal_signal_exit()?  After
I understand that, I'll carefully review the rest of the patch.

Thanks,

Ben.



More information about the dev mailing list