Displaying 2 results from an estimated 2 matches for "d2d0b39".
2017 Nov 14
0
[PATCH 2/3] Avoid race conditions when nbdkit exits.
...quit has been set because the main
+ * thread will be in the process of unloading it. The plugin.unload
+ * callback should always be called.
+ */
+ if (!quit) {
+ if (conn->handle)
+ plugin_close (conn);
+ }
free (conn);
}
diff --git a/src/plugins.c b/src/plugins.c
index d2d0b39..f5056d9 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -48,6 +48,7 @@
static pthread_mutex_t connection_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t all_requests_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_rwlock_t unload_prevention_lock = PTHREAD_RWLOCK_INITIALIZER;
/*...
2017 Nov 14
7
[PATCH 0/3] Alternate way to avoid race conditions when nbdkit exits.
This fixes the race conditions for me, using the test described here:
https://www.redhat.com/archives/libguestfs/2017-September/msg00226.html
Rich.