64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
enum of_thread_running {
OF_THREAD_NOT_RUNNING,
OF_THREAD_RUNNING,
OF_THREAD_WAITING_FOR_JOIN
} _running;
void *_pool;
# ifdef OF_HAVE_BLOCKS
of_thread_block_t _threadBlock;
# endif
id _returnValue;
OFRunLoop *_runLoop;
OFMutableDictionary *_threadDictionary;
@private
OFString *_name;
}
#ifdef OF_HAVE_BLOCKS
/*!
* The block to execute in the thread.
*/
@property (readonly, nonatomic) of_thread_block_t threadBlock;
#endif
/*!
* @brief Creates a new thread.
*
* @return A new, autoreleased thread
*/
+ (instancetype)thread;
|
|
|
|
>
>
>
>
>
|
>
|
|
|
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
enum of_thread_running {
OF_THREAD_NOT_RUNNING,
OF_THREAD_RUNNING,
OF_THREAD_WAITING_FOR_JOIN
} _running;
void *_pool;
# ifdef OF_HAVE_BLOCKS
of_thread_block_t _Nullable _threadBlock;
# endif
id _returnValue;
OFRunLoop *_Nullable _runLoop;
OFMutableDictionary *_threadDictionary;
@private
OFString *_Nullable _name;
}
/*!
* The name for the thread to use when starting it.
*/
@property OF_NULLABLE_PROPERTY (copy, nonatomic) OFString *name;
# ifdef OF_HAVE_BLOCKS
/*!
* The block to execute in the thread.
*/
@property OF_NULLABLE_PROPERTY (readonly, nonatomic)
of_thread_block_t threadBlock;
# endif
/*!
* @brief Creates a new thread.
*
* @return A new, autoreleased thread
*/
+ (instancetype)thread;
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
# endif
/*!
* @brief Returns the current thread.
*
* @return The current thread
*/
+ (OFThread *)currentThread;
/*!
* @brief Returns the main thread.
*
* @return The main thread
*/
+ (OFThread *)mainThread;
/*!
* @brief Returns a dictionary to store thread-specific data, meaning it
* returns a different dictionary for every thread.
*
* @return A dictionary to store thread-specific data.
*/
+ (OFMutableDictionary *)threadDictionary;
#endif
/*!
* @brief Suspends execution of the current thread for the specified time
* interval.
*
* @param timeInterval The number of seconds to sleep
|
|
|
|
|
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
# endif
/*!
* @brief Returns the current thread.
*
* @return The current thread
*/
+ (nullable OFThread *)currentThread;
/*!
* @brief Returns the main thread.
*
* @return The main thread
*/
+ (nullable OFThread *)mainThread;
/*!
* @brief Returns a dictionary to store thread-specific data, meaning it
* returns a different dictionary for every thread.
*
* @return A dictionary to store thread-specific data.
*/
+ (nullable OFMutableDictionary *)threadDictionary;
#endif
/*!
* @brief Suspends execution of the current thread for the specified time
* interval.
*
* @param timeInterval The number of seconds to sleep
|
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
/*!
* @brief Returns the run loop for the thread.
*
* @return The run loop for the thread
*/
- (OFRunLoop *)runLoop;
/*!
* @brief Returns the name of the thread or `nil` if none has been set.
*
* @return The name of the thread or nil if none has been set
*/
- (nullable OFString *)name;
/*!
* @brief Sets the name for the thread.
*
* @param name The name for the thread
*/
- (void)setName: (nullable OFString *)name;
/*!
* @brief Returns the priority of the thread.
*
* This is a value between -1.0 (meaning lowest priority that still schedules)
* and +1.0 (meaning highest priority that still allows getting preempted)
* with normal priority being 0.0 (meaning being the same as the main thread).
*
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
/*!
* @brief Returns the run loop for the thread.
*
* @return The run loop for the thread
*/
- (OFRunLoop *)runLoop;
/*!
* @brief Returns the priority of the thread.
*
* This is a value between -1.0 (meaning lowest priority that still schedules)
* and +1.0 (meaning highest priority that still allows getting preempted)
* with normal priority being 0.0 (meaning being the same as the main thread).
*
|