]> git.saurik.com Git - redis.git/commitdiff
other shared objects where created in the I/O thread in createStringObjectFromLongLon...
authorantirez <antirez@gmail.com>
Thu, 22 Jul 2010 12:48:45 +0000 (14:48 +0200)
committerantirez <antirez@gmail.com>
Thu, 22 Jul 2010 12:48:45 +0000 (14:48 +0200)
src/object.c

index 58f8f44cda6ffb084e561f4c1e875ea77b660094..7abecfc64600073575b3a4831374a11226355ecf 100644 (file)
@@ -35,7 +35,8 @@ robj *createStringObject(char *ptr, size_t len) {
 
 robj *createStringObjectFromLongLong(long long value) {
     robj *o;
 
 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 {
         incrRefCount(shared.integers[value]);
         o = shared.integers[value];
     } else {