ObjFW  Check-in [b3fa788a4e]

Overview
Comment:Release the old return value when restarting a thread.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b3fa788a4e93ce2c177b1c913976995f8c4b93d6db9bed11f9bb9e4375721633
User & Date: js on 2011-04-12 13:21:52
Other Links: manifest | tags
Context
2011-04-12
15:26
Call objc_thread_{add,remove} when using the GNU runtime. check-in: bc76c7f2b0 user: js tags: trunk
13:21
Release the old return value when restarting a thread. check-in: b3fa788a4e user: js tags: trunk
13:06
Detach the thread if it was not joined but we want to re-run it. check-in: 9825bfe451 user: js tags: trunk
Changes

Modified src/OFThread.m from [b7fb0c0ce5] to [593c914f01].

240
241
242
243
244
245
246
247
248


249
250
251
252
253
254
255

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

	if (running = OF_THREAD_WAITING_FORJOIN)
		of_thread_detach(thread);



	[self retain];

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







|

>
>







240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257

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

	if (running = OF_THREAD_WAITING_FOR_JOIN) {
		of_thread_detach(thread);
		[retval release];
	}

	[self retain];

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