ovs-thread: Add checking for mutex and rwlock initialization.
authorBen Pfaff <blp@nicira.com>
Thu, 24 Apr 2014 23:49:05 +0000 (16:49 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 28 Apr 2014 22:54:45 +0000 (15:54 -0700)
commit05bf6d3c62e1d19e192d264682e8239196a56ee9
tree1bc4ea7ac789aa41b725511687f94da9c535b11c
parent2a3fb0aa3c0eef580c11572089bacc65cfd4290a
ovs-thread: Add checking for mutex and rwlock initialization.

With glibc, a mutex or rwlock filled with all-zero-bytes is properly
initialized for use, but this is not true for any other libc that OVS
supports.  However, OVS gets a lot more testing with glibc than any other
libc.  This means that developers keep introducing bugs that do not
manifest on the main development platform.

This commit should help avoid the problem, by reusing the existing 'where'
members to indicate whether a mutex or rwlock has been initialized.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ovs-thread.c
lib/ovs-thread.h