ObjFW  Diff

Differences From Artifact [8d6289db16]:

To Artifact [28529a39cf]:


354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
		of_thread_detach(thread);

	[object release];
	[returnValue release];

	[super dealloc];
}

- (void)finalize
{
	if (running == OF_THREAD_RUNNING)
		@throw [OFThreadStillRunningException newWithClass: isa
							    thread: self];

	/*
	 * We should not be running anymore, but call detach in order to free
	 * the resources.
	 */
	if (running == OF_THREAD_WAITING_FOR_JOIN)
		of_thread_detach(thread);

	[super finalize];
}
@end

@implementation OFTLSKey
+ (void)initialize
{
	if (self == [OFTLSKey class])
		TLSKeys = [[OFList alloc] init];







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







354
355
356
357
358
359
360
















361
362
363
364
365
366
367
		of_thread_detach(thread);

	[object release];
	[returnValue release];

	[super dealloc];
}
















@end

@implementation OFTLSKey
+ (void)initialize
{
	if (self == [OFTLSKey class])
		TLSKeys = [[OFList alloc] init];
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
		@synchronized (TLSKeys) {
			[TLSKeys removeListObject: listObject];
		}
	}

	[super dealloc];
}

- (void)finalize
{
	if (destructor != NULL)
		destructor(self);

	if (initialized)
		of_tlskey_free(key);

	/* In case we called [self release] in init */
	if (listObject != NULL) {
		@synchronized (TLSKeys) {
			[TLSKeys removeListObject: listObject];
		}
	}

	[super finalize];
}
@end

@implementation OFMutex
+ mutex
{
	return [[[self alloc] init] autorelease];
}







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







436
437
438
439
440
441
442


















443
444
445
446
447
448
449
		@synchronized (TLSKeys) {
			[TLSKeys removeListObject: listObject];
		}
	}

	[super dealloc];
}


















@end

@implementation OFMutex
+ mutex
{
	return [[[self alloc] init] autorelease];
}
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
	if (initialized)
		if (!of_mutex_free(&mutex))
			@throw [OFMutexStillLockedException newWithClass: isa
								   mutex: self];

	[super dealloc];
}

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

	[super finalize];
}
@end

@implementation OFCondition
+ condition
{
	return [[[self alloc] init] autorelease];
}







<
<
<
<
<
<
<
<
<
<







487
488
489
490
491
492
493










494
495
496
497
498
499
500
	if (initialized)
		if (!of_mutex_free(&mutex))
			@throw [OFMutexStillLockedException newWithClass: isa
								   mutex: self];

	[super dealloc];
}










@end

@implementation OFCondition
+ condition
{
	return [[[self alloc] init] autorelease];
}
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
		if (!of_condition_free(&condition))
			@throw [OFConditionStillWaitingException
			    newWithClass: isa
			       condition: self];

	[super dealloc];
}

- (void)finalize
{
	if (conditionInitialized)
		if (!of_condition_free(&condition))
			@throw [OFConditionStillWaitingException
			    newWithClass: isa
			       condition: self];

	[super finalize];
}
@end







<
<
<
<
<
<
<
<
<
<
<

541
542
543
544
545
546
547











548
		if (!of_condition_free(&condition))
			@throw [OFConditionStillWaitingException
			    newWithClass: isa
			       condition: self];

	[super dealloc];
}











@end