ObjFW  Check-in [31ff715036]

Overview
Comment:Remove [OFThread initWithObject:block:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 31ff715036a241d415069f7becdc9434b33d613ceb56aed8a9d6ab9ec18c1acf
User & Date: js on 2012-10-02 00:04:15
Other Links: manifest | tags
Context
2012-10-02
00:07
Remove -[OFThreadPool dispatchWithBlock:object:]. check-in: 54e323d0c9 user: js tags: trunk
00:04
Remove [OFThread initWithObject:block:]. check-in: 31ff715036 user: js tags: trunk
00:01
OFTimer: Fix -[waitUntilDone]. check-in: bbc8bb5ad1 user: js tags: trunk
Changes

Modified src/OFThread.h from [fd48a1729f] to [db7d8eaae9].

127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/**
 * \brief Creates a new thread with the specified block.
 *
 * \param block A block which is executed by the thread
 * \return A new, autoreleased thread
 */
+ threadWithBlock: (of_thread_block_t)block;

/**
 * \brief Creates a new thread with the specified block and object.
 *
 * \param object An object which is passed for use in the main method or nil
 * \param block A block which is executed by the thread
 * \return A new, autoreleased thread
 */
+ threadWithObject: (id)object
	     block: (of_thread_block_t)block;
#endif

/**
 * \brief Sets the Thread Local Storage for the specified key.
 *
 * The specified object is first retained and then the object stored before is
 * released. You can specify nil as object if you want the old object to be







<
<
<
<
<
<
<
<
<
<







127
128
129
130
131
132
133










134
135
136
137
138
139
140
/**
 * \brief Creates a new thread with the specified block.
 *
 * \param block A block which is executed by the thread
 * \return A new, autoreleased thread
 */
+ threadWithBlock: (of_thread_block_t)block;










#endif

/**
 * \brief Sets the Thread Local Storage for the specified key.
 *
 * The specified object is first retained and then the object stored before is
 * released. You can specify nil as object if you want the old object to be
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
/**
 * \brief Initializes an already allocated thread with the specified block.
 *
 * \param block A block which is executed by the thread
 * \return An initialized OFThread.
 */
- initWithBlock: (of_thread_block_t)block;

/**
 * \brief Initializes an already allocated thread with the specified block and
 *	  object.
 *
 * \param block A block which is executed by the thread
 * \param object An object which is passed for use in the main method or nil
 * \return An initialized OFThread.
 */
- initWithObject: (id)object
	   block: (of_thread_block_t)block;
#endif

/**
 * \brief The main routine of the thread. You need to reimplement this!
 *
 * It can access the object passed to the threadWithObject or initWithObject
 * method using the instance variable named object.







<
<
<
<
<
<
<
<
<
<
<







217
218
219
220
221
222
223











224
225
226
227
228
229
230
/**
 * \brief Initializes an already allocated thread with the specified block.
 *
 * \param block A block which is executed by the thread
 * \return An initialized OFThread.
 */
- initWithBlock: (of_thread_block_t)block;











#endif

/**
 * \brief The main routine of the thread. You need to reimplement this!
 *
 * It can access the object passed to the threadWithObject or initWithObject
 * method using the instance variable named object.

Modified src/OFThread.m from [c4706ccc79] to [c8c14f68e1].

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

#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);








<
<
<
<
<
<
<







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];
}







#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

	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;







<
<
<
<
<
<
<



<







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_
{







	self = [super init];

	@try {

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

	return self;