summaryrefslogtreecommitdiff
path: root/memcached.h
diff options
context:
space:
mode:
Diffstat (limited to 'memcached.h')
-rw-r--r--memcached.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/memcached.h b/memcached.h
index 0517d4a..0594ab9 100644
--- a/memcached.h
+++ b/memcached.h
@@ -180,6 +180,11 @@ enum network_transport {
udp_transport
};
+enum item_lock_types {
+ ITEM_LOCK_GRANULAR = 0,
+ ITEM_LOCK_GLOBAL
+};
+
#define IS_UDP(x) (x == udp_transport)
#define NREAD_ADD 1
@@ -352,6 +357,7 @@ typedef struct {
struct thread_stats stats; /* Stats generated by this thread */
struct conn_queue *new_conn_queue; /* queue of new connections to handle */
cache_t *suffix_cache; /* suffix cache */
+ uint8_t item_lock_type; /* use fine-grained or global item lock */
} LIBEVENT_THREAD;
typedef struct {
@@ -531,9 +537,13 @@ void item_stats_sizes(ADD_STAT add_stats, void *c);
void item_unlink(item *it);
void item_update(item *it);
+void item_lock_global(void);
+void item_unlock_global(void);
void item_lock(uint32_t hv);
-int item_trylock(uint32_t hv);
+void *item_trylock(uint32_t hv);
+void item_trylock_unlock(void *arg);
void item_unlock(uint32_t hv);
+void switch_item_lock_type(enum item_lock_types type);
unsigned short refcount_incr(unsigned short *refcount);
unsigned short refcount_decr(unsigned short *refcount);
void STATS_LOCK(void);