Differences From Artifact [46f0aec229]:
- File
src/OFThreadPool.m
— part of check-in
[1255f3a11a]
at
2012-08-10 20:08:24
on branch trunk
— Directly use the runtime's autorelease pools.
This greatly improves performance, as it gets rid of the overhead of
OFAutoreleasePool. (user: js, size: 7059) [annotate] [blame] [check-ins using]
To Artifact [743cbdc4ee]:
- File src/OFThreadPool.m — part of check-in [c137da5e5b] at 2012-09-16 15:27:48 on branch trunk — Prefix all private methods with OF_. (user: js, size: 7075) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
329 330 331 332 333 334 335 | [queue release]; [queueCondition release]; [countCondition release]; [super dealloc]; } | | | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | [queue release]; [queueCondition release]; [countCondition release]; [super dealloc]; } - (void)OF_dispatchJob: (OFThreadPoolJob*)job { of_atomic_inc_int(&count); [queueCondition lock]; @try { [queue appendObject: job]; [queueCondition signal]; |
︙ | ︙ | |||
361 362 363 364 365 366 367 | } } - (void)dispatchWithTarget: (id)target selector: (SEL)selector object: (id)object { | | | | | | | | | 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | } } - (void)dispatchWithTarget: (id)target selector: (SEL)selector object: (id)object { [self OF_dispatchJob: [OFThreadPoolJob jobWithTarget: target selector: selector object: object]]; } #ifdef OF_HAVE_BLOCKS - (void)dispatchWithBlock: (of_thread_pool_block_t)block { [self OF_dispatchJob: [OFThreadPoolJob jobWithBlock: block object: nil]]; } - (void)dispatchWithBlock: (of_thread_pool_block_t)block object: (id)object { [self OF_dispatchJob: [OFThreadPoolJob jobWithBlock: block object: object]]; } #endif - (size_t)size { return size; } @end |