Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -36,12 +36,12 @@ /** * \brief A base class for different types of streams. * * \warning Even though the OFCopying protocol is implemented, it does - * not return an independent copy of the stream but instead - * retains it. This is so that the stream can be used as a key for a + * not return an independent copy of the stream, but instead + * retains it. This is so that the stream can be used as a key for a * dictionary, so context can be associated with a stream. Using a * stream in more than one thread at the same time is not thread-safe, * even if copy was called to create one "instance" for every thread! * * \warning If you want to subclass this, override _readIntoBuffer:length:, Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -73,12 +73,17 @@ /** * \brief A class which provides portable threads. * * To use it, you should create a new class derived from it and reimplement * main. + * + * \warning Even though the OFCopying protocol is implemented, it does + * not return an independent copy of the thread, but instead + * retains it. This is so that the thread can be used as a key for a + * dictionary, so context can be associated with a thread. */ -@interface OFThread: OFObject +@interface OFThread: OFObject { #ifdef OF_THREAD_M @public #endif id object; Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -357,10 +357,15 @@ [returnValue release]; [timersQueue release]; [super dealloc]; } + +- copy +{ + return [self retain]; +} @end @implementation OFTLSKey + (void)initialize {