summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamasai <ramasai.tadepalli+3108@gmail.com>2023-02-22 19:31:17 -0500
committerdormando <dormando@rydia.net>2023-03-08 10:45:31 -0800
commit894974de30f6d7155b384dbdf417fa08c1497b1a (patch)
tree4417138f3b9970a752bb14d94d42b9988b374591
parent95a82aa84d59a9208902bcb08594807280742ed8 (diff)
downloadmemcached-894974de30f6d7155b384dbdf417fa08c1497b1a.tar.gz
log: fix race condition while incrementing log entries dropped
-rw-r--r--logger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/logger.c b/logger.c
index e02bb47..ce97d26 100644
--- a/logger.c
+++ b/logger.c
@@ -971,8 +971,8 @@ enum logger_ret_type logger_log(logger *l, const enum log_entry_type event, cons
/* Request a maximum length of data to write to */
e = (logentry *) bipbuf_request(buf, (sizeof(logentry) + reqlen));
if (e == NULL) {
- pthread_mutex_unlock(&l->mutex);
l->dropped++;
+ pthread_mutex_unlock(&l->mutex);
return LOGGER_RET_NOSPACE;
}
e->event = event;