ObjFW  Diff

Differences From Artifact [88e3bb70b2]:

To Artifact [0dc35a7afe]:


237
238
239
240
241
242
243
244


245
246
247
248
249
250


251
252
253
254
255
256
257
258
259


260
261
262
263
264
265
266
267
268
269


270
271
272
273
274
275
276
237
238
239
240
241
242
243

244
245
246
247
248
249
250

251
252
253
254
255
256
257
258
259
260

261
262
263
264
265
266
267
268
269
270
271

272
273
274
275
276
277
278
279
280







-
+
+





-
+
+








-
+
+









-
+
+







- (void)handleTermination
{
}

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

	[self retain];

	if (!of_thread_new(&thread, call_main, self)) {
		[self release];
		@throw [OFThreadStartFailedException newWithClass: isa];
		@throw [OFThreadStartFailedException newWithClass: isa
							   thread: self];
	}

	running = OF_THREAD_RUNNING;
}

- (id)join
{
	if (running == OF_THREAD_NOT_RUNNING || !of_thread_join(thread))
		@throw [OFThreadJoinFailedException newWithClass: isa];
		@throw [OFThreadJoinFailedException newWithClass: isa
							  thread: self];

	running = OF_THREAD_NOT_RUNNING;

	return retval;
}

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

	[object release];
	[retval release];

	[super dealloc];
}
@end