ObjFW  Diff

Differences From Artifact [0dc35a7afe]:

To Artifact [35bdf0d696]:


30
31
32
33
34
35
36
37
38


39
40
41
42
43
44
45
30
31
32
33
34
35
36


37
38
39
40
41
42
43
44
45







-
-
+
+








#import "OFConditionBroadcastFailedException.h"
#import "OFConditionSignalFailedException.h"
#import "OFConditionWaitFailedException.h"
#import "OFConditionWaitingException.h"
#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFMutexLockedException.h"
#import "OFMutexLockFailedException.h"
#import "OFMutexLockFailedException.h"
#import "OFMutexStillLockedException.h"
#import "OFMutexUnlockFailedException.h"
#import "OFNotImplementedException.h"
#import "OFOutOfRangeException.h"
#import "OFThreadJoinFailedException.h"
#import "OFThreadStartFailedException.h"
#import "OFThreadStillRunningException.h"

381
382
383
384
385
386
387
388


389
390
391
392
393
394
395
396
397
398
399


400
401
402
403
404
405
406


407
408
409
410
411
412
413
381
382
383
384
385
386
387

388
389
390
391
392
393
394
395
396
397
398
399

400
401
402
403
404
405
406
407

408
409
410
411
412
413
414
415
416







-
+
+










-
+
+






-
+
+








	return self;
}

- (void)lock
{
	if (!of_mutex_lock(&mutex))
		@throw [OFMutexLockFailedException newWithClass: isa];
		@throw [OFMutexLockFailedException newWithClass: isa
							  mutex: self];
}

- (BOOL)tryLock
{
	return of_mutex_trylock(&mutex);
}

- (void)unlock
{
	if (!of_mutex_unlock(&mutex))
		@throw [OFMutexUnlockFailedException newWithClass: isa];
		@throw [OFMutexUnlockFailedException newWithClass: isa
							    mutex: self];
}

- (void)dealloc
{
	if (initialized)
		if (!of_mutex_free(&mutex))
			@throw [OFMutexLockedException newWithClass: isa];
			@throw [OFMutexStillLockedException newWithClass: isa
								   mutex: self];

	[super dealloc];
}
@end

@implementation OFCondition
+ condition