ObjFW  Diff

Differences From Artifact [c8c14f68e1]:

To Artifact [bab03511a5]:


113
114
115
116
117
118
119
120

121
122
123
124
125

126
127
128
129
130
131

132
133
134
135
136
137
138
113
114
115
116
117
118
119

120
121
122
123
124

125
126
127
128
129
130

131
132
133
134
135
136
137
138







-
+




-
+





-
+







		return;

	if (!of_tlskey_new(&threadSelfKey))
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];
}

+ thread
+ (instancetype)thread
{
	return [[[self alloc] init] autorelease];
}

+ threadWithObject: (id)object
+ (instancetype)threadWithObject: (id)object
{
	return [[[self alloc] initWithObject: object] autorelease];
}

#ifdef OF_HAVE_BLOCKS
+ threadWithBlock: (of_thread_block_t)block
+ (instancetype)threadWithBlock: (of_thread_block_t)block
{
	return [[[self alloc] initWithBlock: block] autorelease];
}
#endif

+ (void)setObject: (id)object
	forTLSKey: (OFTLSKey*)key
366
367
368
369
370
371
372
373

374
375
376
377
378

379
380
381
382
383
384
385
366
367
368
369
370
371
372

373
374
375
376
377

378
379
380
381
382
383
384
385







-
+




-
+







@implementation OFTLSKey
+ (void)initialize
{
	if (self == [OFTLSKey class])
		TLSKeys = [[OFList alloc] init];
}

+ TLSKey
+ (instancetype)TLSKey
{
	return [[[self alloc] init] autorelease];
}

+ TLSKeyWithDestructor: (void(*)(id))destructor
+ (instancetype)TLSKeyWithDestructor: (void(*)(id))destructor
{
	return [[[self alloc] initWithDestructor: destructor] autorelease];
}

+ (void)callAllDestructors
{
	of_list_object_t *iter;
442
443
444
445
446
447
448
449

450
451
452
453
454
455
456
442
443
444
445
446
447
448

449
450
451
452
453
454
455
456







-
+







	}

	[super dealloc];
}
@end

@implementation OFMutex
+ mutex
+ (instancetype)mutex
{
	return [[[self alloc] init] autorelease];
}

- init
{
	self = [super init];
550
551
552
553
554
555
556
557

558
559
560
561
562
563
564
550
551
552
553
554
555
556

557
558
559
560
561
562
563
564







-
+







					 mutex: self];

	[super dealloc];
}
@end

@implementation OFCondition
+ condition
+ (instancetype)condition
{
	return [[[self alloc] init] autorelease];
}

- init
{
	self = [super init];