ObjFW  Diff

Differences From Artifact [bd27888ffe]:

To Artifact [4ccbd9a433]:

  • File src/OFThread.h — part of check-in [bac91ccede] at 2014-05-14 20:45:00 on branch trunk — Add C11 noreturn

    If it's unavailable, it's defined to __attribute__((noreturn)).

    Unfortunately, it cannot be used for ObjC methods, as noreturn is part
    of the return type while __attribute__((noreturn)) needs to be at the
    end for an ObjC method. To make matters worse, even GCC versions that
    accept noreturn don't allow it for an ObjC method. Thus, the only thing
    that can be done is to always use __attribute__((noreturn)) for ObjC
    methods using the OF_METHOD_NORETURN define. (user: js, size: 5097) [annotate] [blame] [check-ins using]


141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
 */
+ (void)yield;

#ifdef OF_HAVE_THREADS
/*!
 * @brief Terminates the current thread, letting it return nil.
 */
+ (void)terminate OF_NO_RETURN;

/*!
 * @brief Terminates the current thread, letting it return the specified object.
 *
 * @param object The object which the terminated thread will return
 */
+ (void)terminateWithObject: (id)object OF_NO_RETURN;

# ifdef OF_HAVE_BLOCKS
/*!
 * @brief Initializes an already allocated thread with the specified block.
 *
 * @param threadBlock A block which is executed by the thread
 * @return An initialized OFThread.







|






|







141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
 */
+ (void)yield;

#ifdef OF_HAVE_THREADS
/*!
 * @brief Terminates the current thread, letting it return nil.
 */
+ (void)terminate OF_METHOD_NORETURN;

/*!
 * @brief Terminates the current thread, letting it return the specified object.
 *
 * @param object The object which the terminated thread will return
 */
+ (void)terminateWithObject: (id)object OF_METHOD_NORETURN;

# ifdef OF_HAVE_BLOCKS
/*!
 * @brief Initializes an already allocated thread with the specified block.
 *
 * @param threadBlock A block which is executed by the thread
 * @return An initialized OFThread.