ccgus/fmdb — pull request #323 by blakewatters (2014-12-17 00:49:22+00:00)
Title: Add jitter to SQLite Busy handler

This patch makes a few small enhancements to the busy handler:

1. It applies a variable jitter on the sleep time between 50 and 100 milliseconds. This will space out retries if you have a bunch of concurrent reads blocking on a write.
2. It checks that `sqlite3_sleep` returned the save value that was passed in and emits a warning if they don’t match. If you are building SQLite yourself and fail to set `-DHAVE_USLEEP=1` then you wind up sleeping for a full second.