From e002ec6801f41d29e1038f687b52dfe6c7fc9c8a Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 22 Jul 2010 14:48:45 +0200 Subject: [PATCH] other shared objects where created in the I/O thread in createStringObjectFromLongLong. Fixed as well. --- src/object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/object.c b/src/object.c index 58f8f44c..7abecfc6 100644 --- a/src/object.c +++ b/src/object.c @@ -35,7 +35,8 @@ robj *createStringObject(char *ptr, size_t len) { robj *createStringObjectFromLongLong(long long value) { robj *o; - if (value >= 0 && value < REDIS_SHARED_INTEGERS) { + if (value >= 0 && value < REDIS_SHARED_INTEGERS && + pthread_equal(pthread_self(),server.mainthread)) { incrRefCount(shared.integers[value]); o = shared.integers[value]; } else { -- 2.45.2