Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -91,14 +91,13 @@ * released. You can specify nil as object if you want the old object to be * released and don't want any new object for the TLS key. * * \param key The Thread Local Storage key * \param obj The object the Thread Local Storage key will be set to - * \return The old object, autoreleased */ -+ (id)setObject: (id)obj - forTLSKey: (OFTLSKey*)key; ++ (void)setObject: (id)obj + forTLSKey: (OFTLSKey*)key; /** * Returns the object for the specified Thread Local Storage key. * * The returned object is not retained and autoreleased for performance Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -72,30 +72,30 @@ + threadWithObject: (id)obj { return [[[self alloc] initWithObject: obj] autorelease]; } -+ (id)setObject: (id)obj - forTLSKey: (OFTLSKey*)key ++ (void)setObject: (id)obj + forTLSKey: (OFTLSKey*)key { id old = of_tlskey_get(key->key); if (!of_tlskey_set(key->key, [obj retain])) @throw [OFInvalidArgumentException newWithClass: self selector: _cmd]; - return [old autorelease]; + [old release]; } + (id)objectForTLSKey: (OFTLSKey*)key { - return of_tlskey_get(key->key); + return [[of_tlskey_get(key->key) retain] autorelease]; } + (OFThread*)currentThread { - return of_tlskey_get(thread_self); + return [[of_tlskey_get(thread_self) retain] autorelease]; } + (void)sleepForTimeInterval: (int64_t)sec { if (sec < 0)