#include <stdlib.h>
#include <errno.h>
+#include <pthread.h>
#include "util.h"
#include "hashmap.h"
/* Tracks all existing hashmaps. Get at it from gdb. See sd_dump_hashmaps.py */
static LIST_HEAD(struct hashmap_debug_info, hashmap_debug_list);
+static pthread_mutex_t hashmap_debug_list_mutex = PTHREAD_MUTEX_INITIALIZER;
#define HASHMAP_DEBUG_FIELDS struct hashmap_debug_info debug;
}
#ifdef ENABLE_DEBUG_HASHMAP
- LIST_PREPEND(debug_list, hashmap_debug_list, &h->debug);
h->debug.func = func;
h->debug.file = file;
h->debug.line = line;
+ assert_se(pthread_mutex_lock(&hashmap_debug_list_mutex) == 0);
+ LIST_PREPEND(debug_list, hashmap_debug_list, &h->debug);
+ assert_se(pthread_mutex_unlock(&hashmap_debug_list_mutex) == 0);
#endif
return h;
assert(!h->n_direct_entries);
#ifdef ENABLE_DEBUG_HASHMAP
+ assert_se(pthread_mutex_lock(&hashmap_debug_list_mutex) == 0);
LIST_REMOVE(debug_list, hashmap_debug_list, &h->debug);
+ assert_se(pthread_mutex_unlock(&hashmap_debug_list_mutex) == 0);
#endif
if (h->from_pool)
return sv;
}
+/// UNNEEDED by elogind
+#if 0
void *ordered_hashmap_next(OrderedHashmap *h, const void *key) {
struct ordered_hashmap_entry *e;
unsigned hash, idx;
return NULL;
return ordered_bucket_at(h, e->iterate_next)->p.value;
}
-
+#endif // 0
int set_consume(Set *s, void *value) {
int r;
return r;
}
+/// UNNEEDED by elogind
+#if 0
int set_put_strdupv(Set *s, char **l) {
int n = 0, r;
char **i;
return n;
}
+#endif // 0