23 #ifdef OF_HAVE_THREADS
27 OF_ASSUME_NONNULL_BEGIN
32 #ifdef OF_HAVE_SOCKETS
38 #if defined(OF_HAVE_THREADS) && defined(OF_HAVE_BLOCKS)
66 #ifdef OF_HAVE_THREADS
70 OFPlainThread _thread;
71 OFPlainThreadAttributes _attr;
73 OFThreadStateNotRunning,
75 OFThreadStateWaitingForJoin
77 # ifndef OF_OBJFW_RUNTIME
80 # ifdef OF_HAVE_BLOCKS
85 bool _supportsSockets;
89 # ifdef OF_HAVE_SOCKETS
96 #ifdef OF_HAVE_CLASS_PROPERTIES
97 # ifdef OF_HAVE_THREADS
98 @property (
class, readonly, nullable, nonatomic)
OFThread *currentThread;
99 @property (
class, readonly, nullable, nonatomic)
OFThread *mainThread;
100 @property (
class, readonly, nonatomic)
bool isMainThread;
101 @property (
class, readonly, nullable, nonatomic)
103 @property (
class, nullable, copy, nonatomic)
OFString *name;
105 # ifdef OF_HAVE_SOCKETS
106 @property (
class, readonly, nonatomic)
OFDNSResolver *DNSResolver;
110 #ifdef OF_HAVE_THREADS
119 @property OF_NULLABLE_PROPERTY (copy)
OFString *name;
121 # ifdef OF_HAVE_BLOCKS
145 @property (nonatomic)
float priority;
155 @property (nonatomic)
size_t stackSize;
168 @property (nonatomic)
bool supportsSockets;
175 + (instancetype)thread;
177 # ifdef OF_HAVE_BLOCKS
192 + (nullable
OFThread *)currentThread;
206 + (bool)isMainThread;
217 #ifdef OF_HAVE_SOCKETS
242 + (void)sleepUntilDate: (
OFDate *)date;
250 #ifdef OF_HAVE_THREADS
254 + (void)terminate OF_NO_RETURN;
262 + (void)terminateWithObject: (nullable
id)object OF_NO_RETURN;
272 + (void)setName: (nullable
OFString *)name;
281 # ifdef OF_HAVE_BLOCKS
304 - (void)handleTermination OF_REQUIRES_SUPER;
322 - (instancetype)init OF_UNAVAILABLE;
326 OF_ASSUME_NONNULL_END
double OFTimeInterval
A time interval in seconds.
Definition: OFObject.h:154
id(^ OFThreadBlock)(void)
A block to be executed in a new thread.
Definition: OFThread.h:44
A class for resolving DNS names.
Definition: OFDNSResolver.h:132
A class for storing, accessing and comparing dates.
Definition: OFDate.h:34
An abstract class for storing and changing objects in a dictionary.
Definition: OFMutableDictionary.h:48
The root class for all other classes inside ObjFW.
Definition: OFObject.h:692
A class providing a run loop for the application and its processes.
Definition: OFRunLoop.h:66
A class for handling strings.
Definition: OFString.h:139
A class which provides portable threads.
Definition: OFThread.h:66
A protocol for the creation of copies.
Definition: OFObject.h:1350