Displaying 3 results from an estimated 3 matches for "gl_lock_init".
2020 Feb 05
1
[PATCH] properly initialize error_data_lock_list before use
...--
lib/handle.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/handle.c b/lib/handle.c
index f61fdbcd3..99a8b8848 100644
--- a/lib/handle.c
+++ b/lib/handle.c
@@ -88,6 +88,7 @@ guestfs_create_flags (unsigned flags, ...)
if (!g) return NULL;
gl_recursive_lock_init (g->lock);
+ gl_lock_init (g->error_data_list_lock);
g->state = CONFIG;
@@ -176,6 +177,7 @@ guestfs_create_flags (unsigned flags, ...)
free (g->append);
guestfs_int_free_error_data_list (g);
gl_tls_key_destroy (g->error_data);
+ gl_lock_destroy (g->error_data_list_lock);
gl_recursive_lock_de...
2014 May 29
2
[PATCH] library: per-handle locking support
...+ gl_lock_unlock (l);
+}
+
+void
+guestfs___per_handle_lock_add (guestfs_h *g)
+{
+ gl_rwlock_wrlock (locks_lock);
+
+ n_handles++;
+ per_handle_locks = realloc (per_handle_locks,
+ sizeof (*per_handle_locks) * n_handles);
+ handles = realloc (handles, sizeof (*handles) * n_handles);
+
+ gl_lock_init (per_handle_locks[n_handles - 1]);
+ handles[n_handles - 1] = g;
+
+ gl_rwlock_unlock (locks_lock);
+}
+
+static void
+___shrink_lock_arrays (void)
+{
+ // locks_lock should be held
+
+ int i;
+ guestfs___lookup_lock_or_abort (NULL, &i);
+
+ memmove (handles + i, handles + i + 1, (n_handl...
2014 Jun 27
3
[PATCH WIP] Can't generate argv variant
Hi everyone,
lately I've been getting familiar with library and working on slight
re-layering of the library. It's about having locking layer in public API and
tracing one layer below that (let's call it __t_ layer. I'm not very good at
making up names, so this is temporary:) ). Then making sure that all generated
public stuff call __t_ layer and all other internal stuff