ObjFW  Diff

Differences From Artifact [28fcccac40]:

To Artifact [bf828006aa]:


82
83
84
85
86
87
88
89

90
91
92
93
94
95
96
82
83
84
85
86
87
88

89
90
91
92
93
94
95
96







-
+







#endif

	[thread handleTermination];

	thread->running = OF_THREAD_WAITING_FOR_JOIN;

	[OFTLSKey callAllDestructors];
	[OFAutoreleasePool _releaseAll];
	[OFAutoreleasePool OF_releaseAll];

	[thread release];

	return 0;
}

@implementation OFThread
219
220
221
222
223
224
225
226

227
228
229
230
231
232
233

234
235
236
237
238
239
240
219
220
221
222
223
224
225

226
227
228
229
230
231
232

233
234
235
236
237
238
239
240







-
+






-
+








		[thread handleTermination];

		thread->running = OF_THREAD_WAITING_FOR_JOIN;
	}

	[OFTLSKey callAllDestructors];
	[OFAutoreleasePool _releaseAll];
	[OFAutoreleasePool OF_releaseAll];

	[thread release];

	of_thread_exit();
}

+ (void)_createMainThread
+ (void)OF_createMainThread
{
	mainThread = [[OFThread alloc] init];
	mainThread->thread = of_thread_current();

	if (!of_tlskey_set(threadSelfKey, mainThread))
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];
324
325
326
327
328
329
330
331

332
333
334
335
336
337
338
324
325
326
327
328
329
330

331
332
333
334
335
336
337
338







-
+







}

- (OFRunLoop*)runLoop
{
	return [[runLoop retain] autorelease];
}

- (void)_setRunLoop: (OFRunLoop*)runLoop_
- (void)OF_setRunLoop: (OFRunLoop*)runLoop_
{
	OFRunLoop *old = runLoop;
	runLoop = [runLoop_ retain];
	[old release];
}

- (void)dealloc
460
461
462
463
464
465
466
467

468
469
470
471
472
473
474
460
461
462
463
464
465
466

467
468
469
470
471
472
473
474







-
+







	}

	initialized = YES;

	return self;
}

- _initWithoutCreatingMutex
- OF_initWithoutCreatingMutex
{
	return [super init];
}

- (void)lock
{
	if (!of_mutex_lock(&mutex))
501
502
503
504
505
506
507
508

509
510
511
512
513
514
515
501
502
503
504
505
506
507

508
509
510
511
512
513
514
515







-
+







	[super dealloc];
}
@end

@implementation OFRecursiveMutex
- init
{
	self = [super _initWithoutCreatingMutex];
	self = [super OF_initWithoutCreatingMutex];

	if (!of_rmutex_new(&rmutex)) {
		Class c = [self class];
		[self release];
		@throw [OFInitializationFailedException exceptionWithClass: c];
	}