20# import "OFPlainThread.h"
23OF_ASSUME_NONNULL_BEGIN
34#if defined(OF_HAVE_THREADS) && defined(OF_HAVE_BLOCKS)
66 OFPlainThread _thread;
67 OFPlainThreadAttributes _attr;
69 OFThreadStateNotRunning,
71 OFThreadStateWaitingForJoin
73# ifndef OF_OBJFW_RUNTIME
81 bool _supportsSockets;
85# ifdef OF_HAVE_SOCKETS
92#ifdef OF_HAVE_CLASS_PROPERTIES
93# ifdef OF_HAVE_THREADS
94@property (
class, readonly, nullable, nonatomic)
OFThread *currentThread;
95@property (
class, readonly, nullable, nonatomic)
OFThread *mainThread;
96@property (
class, readonly, nonatomic)
bool isMainThread;
97@property (
class, readonly, nullable, nonatomic)
99@property (
class, nullable, copy, nonatomic)
OFString *name;
101# ifdef OF_HAVE_SOCKETS
102@property (
class, readonly, nonatomic)
OFDNSResolver *DNSResolver;
106#ifdef OF_HAVE_THREADS
117# ifdef OF_HAVE_BLOCKS
141@property (nonatomic)
float priority;
151@property (nonatomic)
size_t stackSize;
164@property (nonatomic)
bool supportsSockets;
171+ (instancetype)thread;
173# ifdef OF_HAVE_BLOCKS
188+ (nullable
OFThread *)currentThread;
213#ifdef OF_HAVE_SOCKETS
238+ (void)sleepUntilDate: (
OFDate *)date;
246#ifdef OF_HAVE_THREADS
250+ (void)terminate OF_NO_RETURN;
258+ (void)terminateWithObject: (nullable
id)object OF_NO_RETURN;
268+ (void)setName: (nullable
OFString *)name;
277# ifdef OF_HAVE_BLOCKS
300- (void)handleTermination OF_REQUIRES_SUPER;
318- (instancetype)init OF_UNAVAILABLE;
double OFTimeInterval
A time interval in seconds.
Definition OFObject.h:150
id(^ OFThreadBlock)(void)
A block to be executed in a new thread.
Definition OFThread.h:40
A class for resolving DNS names.
Definition OFDNSResolver.h:126
A class for storing, accessing and comparing dates.
Definition OFDate.h:30
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:688
A class providing a run loop for the application and its processes.
Definition OFRunLoop.h:62
A class for handling strings.
Definition OFString.h:135
A class which provides portable threads.
Definition OFThread.h:62
OFString * name
The name for the thread to use when starting it.
Definition OFThread.h:115
OFThreadBlock block
The block to execute in the thread.
Definition OFThread.h:121
A protocol for the creation of copies.
Definition OFObject.h:1346