ObjFW  Diff

Differences From Artifact [ccda29e08b]:

To Artifact [8cac3a9eb9]:


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.
 */

#include "config.h"



#import "OFTimer.h"
#import "OFDate.h"
#import "OFRunLoop.h"
#import "OFCondition.h"

#import "OFInvalidArgumentException.h"
#import "OFNotImplementedException.h"







>
>







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.
 */

#include "config.h"

#include <assert.h>

#import "OFTimer.h"
#import "OFDate.h"
#import "OFRunLoop.h"
#import "OFCondition.h"

#import "OFInvalidArgumentException.h"
#import "OFNotImplementedException.h"
311
312
313
314
315
316
317






318
319
320
321
322
323
324

	return self;
}
#endif

- (void)dealloc
{






	[fireDate release];
	[target release];
	[object1 release];
	[object2 release];
#ifdef OF_HAVE_BLOCKS
	[block release];
#endif







>
>
>
>
>
>







313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332

	return self;
}
#endif

- (void)dealloc
{
	/*
	 * The run loop references the timer, so it should never be deallocated
	 * if it is still in a run loop.
	 */
	assert(inRunLoop == nil);

	[fireDate release];
	[target release];
	[object1 release];
	[object2 release];
#ifdef OF_HAVE_BLOCKS
	[block release];
#endif
387
388
389
390
391
392
393
















394
395
396
397
398
399
400
		isValid = NO;
}

- (OFDate*)fireDate
{
	OF_GETTER(fireDate, YES)
}

















- (double)timeInterval
{
	return interval;
}

- (void)invalidate







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







395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
		isValid = NO;
}

- (OFDate*)fireDate
{
	OF_GETTER(fireDate, YES)
}

- (void)setFireDate: (OFDate*)fireDate_
{
	[self retain];
	@try {
		@synchronized (self) {
			[inRunLoop OF_removeTimer: self];

			OF_SETTER(fireDate, fireDate_, YES, 0)

			[inRunLoop addTimer: self];
		}
	} @finally {
		[self release];
	}
}

- (double)timeInterval
{
	return interval;
}

- (void)invalidate
417
418
419
420
421
422
423





424
		}

		[condition wait];
	} @finally {
		[condition unlock];
	}
}





@end







>
>
>
>
>

441
442
443
444
445
446
447
448
449
450
451
452
453
		}

		[condition wait];
	} @finally {
		[condition unlock];
	}
}

- (void)OF_setInRunLoop: (OFRunLoop*)inRunLoop_
{
	OF_SETTER(inRunLoop, inRunLoop_, YES, 0)
}
@end