summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index f4bbe1e..93867a5 100644
--- a/thread.c
+++ b/thread.c
@@ -112,6 +112,10 @@ void item_lock(uint32_t hv) {
mutex_lock(&item_locks[hv & item_lock_mask]);
}
+int item_trylock(uint32_t hv) {
+ return pthread_mutex_trylock(&item_locks[hv & item_lock_mask]);
+}
+
void item_unlock(uint32_t hv) {
mutex_unlock(&item_locks[hv & item_lock_mask]);
}
@@ -381,7 +385,7 @@ int is_listen_thread() {
item *item_alloc(char *key, size_t nkey, int flags, rel_time_t exptime, int nbytes) {
item *it;
/* do_item_alloc handles its own locks */
- it = do_item_alloc(key, nkey, flags, exptime, nbytes);
+ it = do_item_alloc(key, nkey, flags, exptime, nbytes, 0);
return it;
}