On Oct 9, 2014, at 2:54 PM, Steve Mills <sjmi...@mac.com> wrote:
> 
> On Oct 9, 2014, at 15:07:01, Jens Alfke <j...@mooseyard.com> wrote:
> 
>> First check the docs for the CGImage APIs to see what their thread-safety is 
>> like. I'm guessing you may need to create a new context for each different 
>> thread you use them in. That's relevant because if the operation queue 
>> allows operations to run in parallel, they're each effectively on a 
>> different thread.
> 
> Where does Apple usually put info about whether or not something is thread 
> safe? I thought it was right in the docs after each routine. The one that's 
> hanging for me is CGImageSourceCreateImageAtIndex. Here's the stack. All the 
> stuck threads look like this one:
> 
> #0    0x00007fff8d46ca56 in semaphore_wait_trap ()
> #1    0x00007fff90e69451 in _os_semaphore_wait ()
> #2    0x00007fff97c83258 in dispatch_once_f ()
> #3    0x00007fff90efc50f in readMakerNoteProps ()
> #4    0x00007fff8bd982f9 in readMakerNoteProps ()
> #5    0x00007fff8bd4834d in metadataFromDatablock ()
> #6    0x00007fff8bd47bf8 in metadataFromDatablock ()
> #7    0x00007fff8bd7afed in createMetadataFromDatabuffer ()
> #8    0x00007fff8bd7194e in readExifData ()
> #9    0x00007fff8bd705ff in initImageJPEG ()
> #10   0x00007fff8bd6f1d6 in _CGImagePluginInitJPEG ()
> #11   0x00007fff8bd4528c in makeImagePlus ()
> #12   0x00007fff8bd6a469 in CGImageSourceCreateImageAtIndex ()
> #13   0x00000001000052a0 in -[FFGraphicSearch doesImageMatchURL:] at 
> /Users/tut/Dropbox/FotoFind/FotoFind/FFGraphicSearch.mm:161

This thread is stopped inside dispatch_once(), presumably waiting for some 
other thread to perform the once operation. 

Assuming dispatch_once is working normally, there should be one thread inside 
readMakerNoteProps() and dispatch_once_f() that is doing something else. Can 
you find it? What is it doing?

One way to break dispatch_once is to throw an exception from the once 
operation. If you don't see any thread actually executing the once operation 
then you might try running with an All Exceptions breakpoint and see if 
anything fails there.


-- 
Greg Parker     gpar...@apple.com     Runtime Wrangler



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to