@@ -48,10 +48,15 @@ * * @brief A class which provides portable threads. * * To use it, you should create a new class derived from it and reimplement * main. + * + * @warning Some operating systems such as AmigaOS need special per-thread + * initialization of sockets. If you intend to use sockets in the + * thread, set the @ref usesSockets property to true before starting + * it. * * @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. @@ -74,10 +79,12 @@ # ifdef OF_HAVE_BLOCKS of_thread_block_t _Nullable _threadBlock; # endif jmp_buf _exitEnv; id _returnValue; +@protected + bool _supportsSockets; OFRunLoop *_Nullable _runLoop; OFMutableDictionary *_threadDictionary; @private OFString *_Nullable _name; # ifdef OF_HAVE_SOCKETS @@ -139,10 +146,19 @@ * * @note This has to be set before the thread is started! */ @property (nonatomic) size_t stackSize; +/*! + * @brief Whether the thread supports sockets. + * + * Some operating systems such as AmigaOS need special per-thread + * initialization of sockets. If you intend to use sockets in the thread, set + * this property to true before starting the thread. + */ +@property (nonatomic) bool supportsSockets; + /*! * @brief Creates a new thread. * * @return A new, autoreleased thread */