ObjFW  Diff

Differences From Artifact [3b9d6bd50a]:

To Artifact [b1f565231d]:


118
119
120
121
122
123
124
125

126
127
128
129
130
131
132
118
119
120
121
122
123
124

125
126
127
128
129
130
131
132







-
+







		thread->_returnValue = [[thread main] retain];

	[thread handleTermination];

	thread->_running = OF_THREAD_WAITING_FOR_JOIN;

	objc_autoreleasePoolPop(thread->_pool);
	[OFAutoreleasePool OF_handleThreadTermination];
	[OFAutoreleasePool of_handleThreadTermination];

	[thread release];
}
#endif

@implementation OFThread
#ifdef OF_HAVE_THREADS
257
258
259
260
261
262
263
264

265
266
267
268
269
270
271

272
273
274
275
276
277
278
257
258
259
260
261
262
263

264
265
266
267
268
269
270

271
272
273
274
275
276
277
278







-
+






-
+








		[thread handleTermination];

		thread->_running = OF_THREAD_WAITING_FOR_JOIN;
		objc_autoreleasePoolPop(thread->_pool);
	}

	[OFAutoreleasePool OF_handleThreadTermination];
	[OFAutoreleasePool of_handleThreadTermination];

	[thread release];

	of_thread_exit();
}

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

	if (!of_tlskey_set(threadSelfKey, mainThread))
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];