search for: 196d910

Displaying 3 results from an estimated 3 matches for "196d910".

Did you mean: 196,10
2019 Apr 23
1
[RFC: nbdkit PATCH] cleanup: Assert mutex sanity
...K_FOR_CURRENT_SCOPE(mutex) \ CLEANUP_UNLOCK pthread_mutex_t *_lock = mutex; \ - pthread_mutex_lock (_lock) + do { \ + int _r = pthread_mutex_lock (_lock); \ + assert (!_r); \ + } while (0) #endif /* NBDKIT_CLEANUP_H */ diff --git a/common/utils/cleanup.c b/common/utils/cleanup.c index 196d910..995f46c 100644 --- a/common/utils/cleanup.c +++ b/common/utils/cleanup.c @@ -53,5 +53,6 @@ cleanup_extents_free (void *ptr) void cleanup_unlock (pthread_mutex_t **ptr) { - pthread_mutex_unlock (*ptr); + int r = pthread_mutex_unlock (*ptr); + assert (!r); } -- 2.20.1
2019 Apr 23
0
[nbdkit PATCH 1/4] cleanup: Move cleanup.c to common
...RRENT_SCOPE(mutex) \ - CLEANUP_UNLOCK pthread_mutex_t *_lock = mutex; \ - pthread_mutex_lock (_lock) - /* connections.c */ struct connection; diff --git a/server/cleanup.c b/common/utils/cleanup.c similarity index 96% rename from server/cleanup.c rename to common/utils/cleanup.c index 292f1ce..196d910 100644 --- a/server/cleanup.c +++ b/common/utils/cleanup.c @@ -34,10 +34,9 @@ #include <stdio.h> #include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include "internal.h" +#include "cleanup.h" +#include "nbdkit-filter.h" void c...
2019 Apr 23
8
[nbdkit PATCH 0/4] Start using cleanup macros in filters/plugins
There's more that can be done (in particular, use of CLEANUP_FREE), but this is enough to at least see if I'm on the right track. I couldn't figure out an obvious difference between common/include and common/utils, but it looks like the former is for things that are inlineable via .h only, while the latter is when you need to link in a convenience library, so this landed in the