20 #ifdef OF_HAVE_THREADS
24 OF_ASSUME_NONNULL_BEGIN
29 #ifdef OF_HAVE_SOCKETS
35 #if defined(OF_HAVE_THREADS) && defined(OF_HAVE_BLOCKS)
63 #ifdef OF_HAVE_THREADS
68 of_thread_attr_t _attr;
69 enum of_thread_running {
70 OF_THREAD_NOT_RUNNING,
72 OF_THREAD_WAITING_FOR_JOIN
74 # ifndef OF_OBJFW_RUNTIME
77 # ifdef OF_HAVE_BLOCKS
82 bool _supportsSockets;
86 # ifdef OF_HAVE_SOCKETS
93 #ifdef OF_HAVE_CLASS_PROPERTIES
94 # ifdef OF_HAVE_THREADS
95 @property (
class, readonly, nullable, nonatomic)
OFThread *currentThread;
96 @property (
class, readonly, nullable, nonatomic)
OFThread *mainThread;
97 @property (
class, readonly, nonatomic)
bool isMainThread;
98 @property (
class, readonly, nullable, nonatomic)
100 @property (
class, nullable, copy, nonatomic)
OFString *name;
102 # ifdef OF_HAVE_SOCKETS
103 @property (
class, readonly, nonatomic)
OFDNSResolver *DNSResolver;
107 #ifdef OF_HAVE_THREADS
118 # ifdef OF_HAVE_BLOCKS
122 @property OF_NULLABLE_PROPERTY (readonly, nonatomic)
140 @property (nonatomic)
float priority;
147 @property (nonatomic)
size_t stackSize;
156 @property (nonatomic)
bool supportsSockets;
163 + (instancetype)thread;
165 # ifdef OF_HAVE_BLOCKS
180 + (nullable
OFThread *)currentThread;
194 + (bool)isMainThread;
205 #ifdef OF_HAVE_SOCKETS
227 + (void)sleepUntilDate: (
OFDate *)date;
235 #ifdef OF_HAVE_THREADS
239 + (void)terminate OF_NO_RETURN;
246 + (void)terminateWithObject: (nullable
id)object OF_NO_RETURN;
256 + (void)setName: (nullable
OFString *)name;
265 # ifdef OF_HAVE_BLOCKS
288 - (void)handleTermination OF_REQUIRES_SUPER;
302 - (instancetype)init OF_UNAVAILABLE;
306 OF_ASSUME_NONNULL_END
double of_time_interval_t
A time interval in seconds.
Definition: OFObject.h:138
id _Nullable(^ of_thread_block_t)(void)
A block to be executed in a new thread.
Definition: OFThread.h:41
struct objc_object * id
A pointer to any object.
Definition: ObjFWRT.h:90
A class for resolving DNS names.
Definition: OFDNSResolver.h:126
A class for storing, accessing and comparing dates.
Definition: OFDate.h:36
An abstract class for storing and changing objects in a dictionary.
Definition: OFMutableDictionary.h:44
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520
A class providing a run loop for the application and its processes.
Definition: OFRunLoop.h:62
A class for handling strings.
Definition: OFString.h:132
A class which provides portable threads.
Definition: OFThread.h:63
OFString * name
The name for the thread to use when starting it.
Definition: OFThread.h:116
A protocol for the creation of copies.
Definition: OFObject.h:1187