45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFOutOfRangeException.h"
#import "OFThreadJoinFailedException.h"
#import "OFThreadStartFailedException.h"
#import "OFThreadStillRunningException.h"
#import "atomic.h"
#import "autorelease.h"
#import "threading.h"
static of_tlskey_t threadSelfKey;
static OFThread *mainThread;
static id
|
>
|
>
|
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"
#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
|
- copy
{
return [self retain];
}
- (OFRunLoop*)runLoop
{
if (runLoop == nil) {
OFRunLoop *tmp = [[OFRunLoop alloc] init];
if (!of_atomic_cmpswap_ptr((void**)&runLoop, nil, tmp))
[tmp release];
}
return [[runLoop retain] autorelease];
}
- (OFString*)name
{
OF_GETTER(name, YES)
|
>
>
>
>
>
>
>
|
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)
|