I have a dead end in an iOS app between UIImage drawInRectin the main thread and UIApplication beginBackgroundTaskWithExpirationHandlerin the background thread. In the main thread, the stack looks like this:
0 semaphore_wait_drap
1 _dispatch_group_wait_slow
2 copyImageBlockSetJPEG
3 ImageProviderCopyImageBlockSetCallback
4 img_blocks_create
5 img_data_lock
6 CGSImageDataLock
7 ripc_AcquireImage
8 ripc_DrawImage
9 CGContextDrawImage
10 [UIImage drawInRect: blendMode: alpha:]
11 [UIImage scaleToSize: interpolationQuality:]
Frame 11 is a category method for scaling an image. Basically, start the context of drawing the image, draw the image in this context at 0.0 with the desired size and get the image out of context.
The background thread stack looks like this:
0 semaphore_wait_trap
1 dispatch_semaphore_wait_slow
2 _addBackgroundTask
3 [UIApplication beginBackgroundTaskWithExpirationHandler:]
, ?
. , . , iOS?