ObjFW  Diff

Differences From Artifact [0374131e0b]:

To Artifact [8f1282cf3c]:


12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFMutex.h"



/*!
 * @brief A class implementing a condition variable for thread synchronization.
 */
@interface OFCondition: OFMutex
{
	of_condition_t _condition;
	bool _conditionInitialized;







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFMutex.h"

@class OFDate;

/*!
 * @brief A class implementing a condition variable for thread synchronization.
 */
@interface OFCondition: OFMutex
{
	of_condition_t _condition;
	bool _conditionInitialized;
34
35
36
37
38
39
40


















41
42
43
44
45
46
47
48
49
50

/*!
 * @brief Blocks the current thread until another thread calls @ref signal or
 *	  @ref broadcast.
 */
- (void)wait;



















/*!
 * @brief Signals the next waiting thread to continue.
 */
- (void)signal;

/*!
 * @brief Signals all threads to continue.
 */
- (void)broadcast;
@end







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

/*!
 * @brief Blocks the current thread until another thread calls @ref signal or
 *	  @ref broadcast.
 */
- (void)wait;

/*!
 * @brief Blocks the current thread until another thread calls @ref signal,
 *	  @ref broadcast or the timeout is reached.
 *
 * @param timeInterval The time interval until the timeout is reached
 * @return Whether the condition has been signaled
 */
- (bool)waitForTimeInterval: (double)timeInterval;

/*!
 * @brief Blocks the current thread until another thread calls @ref signal,
 *	  @ref broadcast or the timeout is reached.
 *
 * @param date The date at which the timeout is reached
 * @return Whether the condition has been signaled
 */
- (bool)waitUntilDate: (OFDate*)date;

/*!
 * @brief Signals the next waiting thread to continue.
 */
- (void)signal;

/*!
 * @brief Signals all threads to continue.
 */
- (void)broadcast;
@end