@@ -64,10 +64,13 @@ */ @interface OFStreamSocket: OFStream { OFSocketHandle _socket; +#ifdef OF_AMIGAOS + LONG _socketID; +#endif bool _atEndOfStream, _listening; OFSocketAddress _remoteAddress; OF_RESERVE_IVARS(OFStreamSocket, 4) } @@ -159,8 +162,32 @@ * by the specified block as well. */ - (void)asyncAcceptWithRunLoopMode: (OFRunLoopMode)runLoopMode block: (OFStreamSocketAsyncAcceptBlock)block; #endif + +/** + * @brief Releases the socket from the current thread. + * + * This is necessary on some platforms in order to allow a different thread to + * use the socket, e.g. on AmigaOS, but you should call it on all operating + * systems before using the socket from a different thread. + * + * After calling this method, you must no longer use the socket until @ref + * obtainSocketForThread has been called. + */ +- (void)releaseSocketFromCurrentThread; + +/** + * @brief Obtains the socket for the current thread. + * + * This is necessary on some platforms in order to allow a different thread to + * use the socket, e.g. on AmigaOS, but you should call it on all operating + * systems before using the socket from a different thread. + * + * You must only call this method after @ref releaseSocketFromCurrentThread has + * been called from a different thread. + */ +- (void)obtainSocketForCurrentThread; @end OF_ASSUME_NONNULL_END