Displaying 2 results from an estimated 2 matches for "cleanup_release_lock".
2015 Jun 11
1
Re: [PATCH 2/5] threads: Acquire and release the lock around each public guestfs_* API.
...rst ACQUIRE_LOCK ... RELEASE_LOCK
pattern in the patch)
there could be an extra macro to do a "stack lock", using the cleanup
attribute we use already; something like:
static inline guestfs_h *acquire_lock (guestfs_h *g)
{
ACQUIRE_LOCK (g);
return g;
}
static inline void cleanup_release_lock (void *ptr)
{
guestfs_h *g = * (guestfs_h **) ptr;
RELEASE_LOCK (g);
}
#define STACK_LOCK (g) \
__attribute__((cleanup(cleanup_release_lock))) \
guestfs_h *_stack_lock_ = acquire_lock (g)
then the function above could look like:
const char *
guestfs_last_error (guest...
2015 Jun 06
7
[PATCH 0/5] Add support for thread-safe handle.
This patch isn't ready to go upstream. In fact, I think we might do a
quick 1.30 release soon, and save this patch, and also the extensive
changes proposed for the test suite[1], to after 1.30.
Currently it is not safe to use the same handle from multiple threads,
unless you implement your own mutexes. See:
http://libguestfs.org/guestfs.3.html#multiple-handles-and-multiple-threads
These