search for: _stack_lock_

Displaying 2 results from an estimated 2 matches for "_stack_lock_".

2015 Jun 11
1
Re: [PATCH 2/5] threads: Acquire and release the lock around each public guestfs_* API.
...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 (guestfs_h *g) { STACK_LOCK (g); return g->last_error; } This would have the drawback of requiring __attribute__((cleanup)) to work, although that could mean we could drop the code hand...
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