Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Comparing dispatch_get_current_queue and dispatch_get_main_queue is explicitly forbidden by the documentation #20
Checking the right way if a method is invoked from the main thread. The GCD documentation states: (
added a commit
this pull request
Feb 9, 2013
Oh yeah, I meant isMainThread :)
On Friday, February 8, 2013, Oliver Drobnik wrote: Actually you had a bug there. the [self isMainThread] always returns true because [NSThread mainThread] always returns a valid main thread. I fixed that in a later commit and removed the single-statement method. e5a4574e5a4574 — Reply to this email directly or view it on GitHubhttps://github.com/JaviSoto/DTFoundation/commit/4019b91303accc3ccd87080204c18df54c95090d#commitcomment-2591539..
## Javier Soto
In my experience, that code works anyway. It's just dangerous to not follow the documentation. I actually use `dispatch_get_current_queue()` which is deprecated to implement a "dipatch_safe_sync()" avoiding a deadlock just calling the black if it's gonna be dispatched on the current queue. I just don't know what the right way to do that would be :) Thanks for quoting me in your article!
On Friday, February 8, 2013, Oliver Drobnik wrote: Not to worry. Either way thank you very much for your impetus! I learned quite a bit from this, even though it is slightly embarrassing having to go back into an article that many people have read and liked and make changes stemming from my own ignorance. — Reply to this email directly or view it on GitHubhttps://github.com/JaviSoto/DTFoundation/commit/4019b91303accc3ccd87080204c18df54c95090d#commitcomment-2591582..
## Javier Soto