[ovs-git] [openvswitch/ovs] d2843e: ovs_threads: Avoid running pthread destructors fro...

GitHub noreply at github.com
Wed May 27 16:44:10 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: d2843eba6d939526eb3daef511099bed2d18dd2c
      https://github.com/openvswitch/ovs/commit/d2843eba6d939526eb3daef511099bed2d18dd2c
  Author: Gurucharan Shetty <gshetty at nicira.com>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M lib/ovs-rcu.c
    M lib/ovs-thread.c
    M tests/test-atomic.c

  Log Message:
  -----------
  ovs_threads: Avoid running pthread destructors from main thread exit.

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, causing pthread deadlocks).
Similar behavior has been seen by
other people as seen in the following email thread:
https://sourceware.org/ml/pthreads-win32/2003/msg00001.html

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>
Acked-by: Ben Pfaff <blp at nicira.com>




More information about the git mailing list