ccgus/fmdb — pull request #224 by mikeash (2014-01-17 19:53:15+00:00)
Title: Add a deadlock check to -[FMDatabaseQueue inDatabase:]

Reentrantly calling `-inDatabase:` causes a deadlock which can be kind of annoying to debug, especially if it happens on a background thread and doesn't immediately lock up the UI. This adds a check for reentrant calls and asserts if they happen, causing a nice clean crash instead. The check is not 100% reliable (e.g. two queues which reentrantly call each other will still deadlock but won't be detected) but should catch the common case.