119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
+
-
+
-
-
-
+
+
|
#ifdef OF_HAVE_BLOCKS
+ threadWithBlock: (of_thread_block_t)block
{
return [[[self alloc] initWithBlock: block] autorelease];
}
+ threadWithObject: (id)object
+ threadWithBlock: (of_thread_block_t)block
block: (of_thread_block_t)block
object: (id)object
{
return [[[self alloc] initWithBlock: block
object: object] autorelease];
return [[[self alloc] initWithObject: object
block: block] autorelease];
}
#endif
+ (void)setObject: (id)object
forTLSKey: (OFTLSKey*)key
{
id oldObject = of_tlskey_get(key->key);
|
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
-
-
+
+
+
-
+
-
-
+
|
return self;
}
#ifdef OF_HAVE_BLOCKS
- initWithBlock: (of_thread_block_t)block_
{
return [self initWithBlock: block_
object: nil];
return [self initWithObject: nil
block: block_];
}
- initWithObject: (id)object_
- initWithBlock: (of_thread_block_t)block_
block: (of_thread_block_t)block_
object: (id)object_
{
self = [super init];
@try {
block = [block_ copy];
object = [object_ retain];
block = [block_ copy];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
|