ovs-thread: Add support for convenient once-only initializers.
authorBen Pfaff <blp@nicira.com>
Wed, 19 Jun 2013 18:21:47 +0000 (11:21 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 28 Jun 2013 23:09:36 +0000 (16:09 -0700)
commit1514b275558304c63bc3838c2da5c4be0c1cbef0
treea460f9a18cf7ee9a4c70a99cf51676733d0c0720
parent31a3fc6e3e9ce68d8bfebf65150d9455b9334dda
ovs-thread: Add support for convenient once-only initializers.

pthread_once() is portable but it does not allow passing any parameters to
the initialization function, which is often inconvenient, because it means
that the function can only access data declared at file scope.  This commit
introduces an alternative with a more convenient interface.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Makefile.am
lib/ovs-thread.c
lib/ovs-thread.h