ObjFW  Check-in [d0eb2ddd31]

Overview
Comment:OFThread: Fix compilation without atomic ops.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d0eb2ddd31fff4b99a89adc2edf9be3192d7540bb4f4700b0ab20ddceb1a36b4
User & Date: js on 2013-01-15 02:11:53
Other Links: manifest | tags
Context
2013-01-15
02:33
-[OFString cStringWithEncoding:]: Add Windows-1252 check-in: 7a14ffd2cb user: js tags: trunk
02:11
OFThread: Fix compilation without atomic ops. check-in: d0eb2ddd31 user: js tags: trunk
02:06
Prevent importing atomic.h without atomic ops. check-in: a7c16ea8b3 user: js tags: trunk
Changes

Modified src/OFThread.m from [4dcc89a58d] to [750512444c].

45
46
47
48
49
50
51

52


53
54
55
56
57
58
59
45
46
47
48
49
50
51
52

53
54
55
56
57
58
59
60
61







+
-
+
+







#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFOutOfRangeException.h"
#import "OFThreadJoinFailedException.h"
#import "OFThreadStartFailedException.h"
#import "OFThreadStillRunningException.h"

#ifdef OF_HAVE_ATOMIC_OPS
#import "atomic.h"
# import "atomic.h"
#endif
#import "autorelease.h"
#import "threading.h"

static of_tlskey_t threadSelfKey;
static OFThread *mainThread;

static id
323
324
325
326
327
328
329

330
331
332
333
334
335






336
337
338
339
340
341
342
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351







+






+
+
+
+
+
+







- copy
{
	return [self retain];
}

- (OFRunLoop*)runLoop
{
#ifdef OF_HAVE_ATOMIC_OPS
	if (runLoop == nil) {
		OFRunLoop *tmp = [[OFRunLoop alloc] init];

		if (!of_atomic_cmpswap_ptr((void**)&runLoop, nil, tmp))
			[tmp release];
	}
#else
	@synchronized (self) {
		if (runLoop == nil)
			runLoop = [[OFRunLoop alloc] init];
	}
#endif

	return [[runLoop retain] autorelease];
}

- (OFString*)name
{
	OF_GETTER(name, YES)