ObjFW  Diff

Differences From Artifact [c4706ccc79]:

To Artifact [c8c14f68e1]:


128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
128
129
130
131
132
133
134







135
136
137
138
139
140
141







-
-
-
-
-
-
-







}

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

+ threadWithObject: (id)object
	     block: (of_thread_block_t)block
{
	return [[[self alloc] initWithObject: object
				       block: block] autorelease];
}
#endif

+ (void)setObject: (id)object
	forTLSKey: (OFTLSKey*)key
{
	id oldObject = of_tlskey_get(key->key);

264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
257
258
259
260
261
262
263







264
265
266

267
268
269
270
271
272
273







-
-
-
-
-
-
-



-








	return self;
}

#ifdef OF_HAVE_BLOCKS
- initWithBlock: (of_thread_block_t)block_
{
	return [self initWithObject: nil
			      block: block_];
}

- initWithObject: (id)object_
	   block: (of_thread_block_t)block_
{
	self = [super init];

	@try {
		object = [object_ retain];
		block = [block_ copy];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;