Differences From Artifact [dc390a6e23]:
- File
src/OFThread.h
— part of check-in
[5358e9ea6a]
at
2019-08-01 20:14:35
on branch trunk
— Split threading.[hm] into multiple files
This allows the runtime to only link against the parts it needs, without
pulling in unnecessary parts like thread spawning, TLS and conditions. (user: js, size: 7095) [annotate] [blame] [check-ins using]
To Artifact [f242100e35]:
- File src/OFThread.h — part of check-in [a40f3fc829] at 2019-08-11 18:56:14 on branch trunk — Support sockets in multiple threads on AmigaOS (user: js, size: 7662) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
46 47 48 49 50 51 52 53 54 55 56 57 58 59 | /*! * @class OFThread OFThread.h ObjFW/OFThread.h * * @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 | > > > > > | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | /*! * @class OFThread OFThread.h ObjFW/OFThread.h * * @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. */ @interface OFThread: OFObject |
︙ | ︙ | |||
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | } _running; void *_pool; # ifdef OF_HAVE_BLOCKS of_thread_block_t _Nullable _threadBlock; # endif jmp_buf _exitEnv; id _returnValue; OFRunLoop *_Nullable _runLoop; OFMutableDictionary *_threadDictionary; @private OFString *_Nullable _name; # ifdef OF_HAVE_SOCKETS OFDNSResolver *_DNSResolver; # endif | > > | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | } _running; void *_pool; # 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 OFDNSResolver *_DNSResolver; # endif |
︙ | ︙ | |||
137 138 139 140 141 142 143 144 145 146 147 148 149 150 | /*! * @brief The stack size of the thread. * * @note This has to be set before the thread is started! */ @property (nonatomic) size_t stackSize; /*! * @brief Creates a new thread. * * @return A new, autoreleased thread */ + (instancetype)thread; | > > > > > > > > > | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | /*! * @brief The stack size of the thread. * * @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 */ + (instancetype)thread; |
︙ | ︙ |