@@ -25,10 +25,13 @@ #import "OFStream+Private.h" #ifndef OF_HAVE_PIPE # import "OFStreamSocket.h" #endif #import "OFDate.h" +#ifdef OF_HAVE_THREADS +# import "OFMutex.h" +#endif #ifdef HAVE_KQUEUE # import "OFKernelEventObserver_kqueue.h" #endif #ifdef HAVE_EPOLL @@ -128,10 +131,14 @@ &cancelAddrLen) != 0) @throw [OFInitializationFailedException exceptionWithClass: [self class]]; # endif #endif + +#ifdef OF_HAVE_THREADS + _mutex = [[OFMutex alloc] init]; +#endif } @catch (id e) { [self release]; @throw e; } @@ -148,10 +155,14 @@ of_socket_port_free(_cancelAddr.sin_port, SOCK_DGRAM); #endif [_readObjects release]; [_writeObjects release]; + +#ifdef OF_HAVE_THREADS + [_mutex release]; +#endif [super dealloc]; } - (void)addObjectForReading: (id )object