ObjFW  Diff

Differences From Artifact [89cb894f3a]:

To Artifact [ed37db867b]:

  • File src/OFThread.m — part of check-in [48980f2297] at 2015-11-29 11:43:05 on branch trunk — Make properties a requirement and clean up code

    This increases the required GCC version from 4.0 to 4.6 (exception:
    Apple GCC, which already supports this with >= 4.0 starting with OS X
    10.5). Since even GCC 4.6 is really old by now, there is no point in
    still supporting something even older and making the code ugly because
    of that. While some hardware and OS support was dropped from GCC 4.6
    compared to GCC 4.0, there is nothing in there that would be an
    interesting target with the exception of BeOS maybe - but a port to BeOS
    can also be achieved using the Haiku support. The other dropped OSes are
    mostly old versions of OSes while newer ones are still being supported
    (and those newer versions of those OSes still support the same
    hardware). (user: js, size: 8707) [annotate] [blame] [check-ins using]


122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

	[thread release];
}
#endif

@implementation OFThread
#ifdef OF_HAVE_THREADS
# if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS)
@synthesize threadBlock = _threadBlock;
# endif

+ (void)initialize
{
	if (self != [OFThread class])
		return;







|







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

	[thread release];
}
#endif

@implementation OFThread
#ifdef OF_HAVE_THREADS
# ifdef OF_HAVE_BLOCKS
@synthesize threadBlock = _threadBlock;
# endif

+ (void)initialize
{
	if (self != [OFThread class])
		return;
376
377
378
379
380
381
382
383
384
385
386
387

388

389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# endif

	return [[_runLoop retain] autorelease];
}

- (OFString*)name
{
	OF_GETTER(_name, true)
}

- (void)setName: (OFString*)name
{

	OF_SETTER(_name, name, true, 1)


	if (_running == OF_THREAD_RUNNING) {
		if (_name != nil)
			of_thread_set_name(_thread, [_name UTF8String]);
		else
			of_thread_set_name(_thread,
			    class_getName([self class]));
	}
}

- (float)priority
{
	return _attr.priority;
}








|




>
|
>

|
<
|
<
<
|
<







376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392

393


394

395
396
397
398
399
400
401
# endif

	return [[_runLoop retain] autorelease];
}

- (OFString*)name
{
	return [[_name copy] autorelease];
}

- (void)setName: (OFString*)name
{
	OFString *old = name;
	_name = [name copy];
	[old release];

	if (_running == OF_THREAD_RUNNING)

		of_thread_set_name(_thread, (_name != nil


		    ? [_name UTF8String] : class_getName([self class])));

}

- (float)priority
{
	return _attr.priority;
}