Overview
| Comment: | Remove -[OFThreadPool dispatchWithBlock:object:]. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
54e323d0c984b5af6032709fa1e4b8e3 |
| User & Date: | js on 2012-10-02 00:07:46 |
| Other Links: | manifest | tags |
Context
|
2012-10-02
| ||
| 11:00 | Clean up properties in exceptions. (check-in: c7adbcf399 user: js tags: trunk) | |
| 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) | |
Changes
Modified src/OFThreadPool.h from [1c2b5c4b19] to [b5511b4c56].
| ︙ | ︙ | |||
13 14 15 16 17 18 19 | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifdef OF_HAVE_BLOCKS | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifdef OF_HAVE_BLOCKS typedef void (^of_thread_pool_block_t)(void); #endif @class OFMutableArray; @class OFList; @class OFCondition; @class OFThreadPoolJob; |
| ︙ | ︙ | |||
103 104 105 106 107 108 109 | #ifdef OF_HAVE_BLOCKS /** * \brief Executes the specified block as soon as a thread is ready. * * \param block The block to execute */ - (void)dispatchWithBlock: (of_thread_pool_block_t)block; | < < < < < < < < < | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | #ifdef OF_HAVE_BLOCKS /** * \brief Executes the specified block as soon as a thread is ready. * * \param block The block to execute */ - (void)dispatchWithBlock: (of_thread_pool_block_t)block; #endif /** * \brief Waits until all jobs are done. */ - (void)waitUntilDone; |
| ︙ | ︙ |
Modified src/OFThreadPool.m from [dcfb0c9b58] to [1b7b5d2a56].
| ︙ | ︙ | |||
33 34 35 36 37 38 39 |
#endif
}
+ jobWithTarget: (id)target
selector: (SEL)selector
object: (id)object;
#ifdef OF_HAVE_BLOCKS
| | < | < < | < | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
#endif
}
+ jobWithTarget: (id)target
selector: (SEL)selector
object: (id)object;
#ifdef OF_HAVE_BLOCKS
+ jobWithBlock: (of_thread_pool_block_t)block;
#endif
- initWithTarget: (id)target
selector: (SEL)selector
object: (id)object;
#ifdef OF_HAVE_BLOCKS
- initWithBlock: (of_thread_pool_block_t)block;
#endif
- (void)perform;
@end
@implementation OFThreadPoolJob
+ jobWithTarget: (id)target
selector: (SEL)selector
object: (id)object
{
return [[[self alloc] initWithTarget: target
selector: selector
object: object] autorelease];
}
#ifdef OF_HAVE_BLOCKS
+ jobWithBlock: (of_thread_pool_block_t)block
{
return [[(OFThreadPoolJob*)[self alloc]
initWithBlock: block] autorelease];
}
#endif
- initWithTarget: (id)target_
selector: (SEL)selector_
object: (id)object_
{
|
| ︙ | ︙ | |||
86 87 88 89 90 91 92 | } return self; } #ifdef OF_HAVE_BLOCKS - initWithBlock: (of_thread_pool_block_t)block_ | < < | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
}
return self;
}
#ifdef OF_HAVE_BLOCKS
- initWithBlock: (of_thread_pool_block_t)block_
{
self = [super init];
@try {
block = [block_ copy];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
|
| ︙ | ︙ | |||
117 118 119 120 121 122 123 |
[super dealloc];
}
- (void)perform
{
#ifdef OF_HAVE_BLOCKS
if (block != NULL)
| | | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
[super dealloc];
}
- (void)perform
{
#ifdef OF_HAVE_BLOCKS
if (block != NULL)
block();
else
#endif
[object performSelector: selector
withObject: object];
}
@end
|
| ︙ | ︙ | |||
369 370 371 372 373 374 375 |
selector: selector
object: object]];
}
#ifdef OF_HAVE_BLOCKS
- (void)dispatchWithBlock: (of_thread_pool_block_t)block
{
| | < < < < < < < < | 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
selector: selector
object: object]];
}
#ifdef OF_HAVE_BLOCKS
- (void)dispatchWithBlock: (of_thread_pool_block_t)block
{
[self OF_dispatchJob: [OFThreadPoolJob jobWithBlock: block]];
}
#endif
- (size_t)size
{
return size;
}
@end
|