After changing my NSURLConnection client code to use operation queues instead of runloop-based delegate calls, I'm running into a repeatable deadlock; but only on iOS (5.1, including the simulator), not Mac OS X 10.7.3.
(gdb) bt
#0 0x972cb83e in __psynch_cvwait ()
#1 0x90a25e21 in _pthread_cond_wait ()
#2 0x909d642c in pthread_cond_wait$UNIX2003 ()
#3 0x00bea8ec in -[__NSOperationInternal waitUntilFinished] ()
#4 0x00bea84e in -[NSOperation waitUntilFinished] ()
#5 0x00c9fefe in -[NSURLConnectionInternalConnection invokeForDelegate:] ()
#6 0x00c9ee3f in -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] ()
#7 0x00c9efc5 in -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] ()
#8 0x00be35bb in _NSURLConnectionDidReceiveResponse ()
#9 0x03d39887 in URLConnectionClient::_clientSendDidReceiveResponse ()
#10 0x03e07710 in URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload ()
#11 0x03e07861 in URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload ()
#12 0x03d31120 in URLConnectionClient::processEvents ()
#13 0x03e07117 in non-virtual thunk to URLConnectionInstanceData::multiplexerClientPerform() ()
#14 0x03d30fbf in MultiplexerSource::perform ()
#15 0x0123894f in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#16 0x0119bb43 in __CFRunLoopDoSources0 ()
#17 0x0119b424 in __CFRunLoopRun ()
#18 0x0119ad84 in CFRunLoopRunSpecific ()
#19 0x0119ac9b in CFRunLoopRunInMode ()
#20 0x00be340f in -[NSRunLoop(NSRunLoop) runMode:beforeDate:] ()
#21 0x00080ed8 in Test_TDMultipartDownloader () at /Volumes/HardDisk/Couchbase/TouchDB/Source/TDMultipartDownloader.m:280
#22 0x000664a6 in RunTestCase (test=0xed904) at /Volumes/HardDisk/Couchbase/TouchDB/vendor/MYUtilities/Test.m:53
#23 0x00066983 in RunTestCases (argc=11, argv=0xbffff5bc) at /Volumes/HardDisk/Couchbase/TouchDB/vendor/MYUtilities/Test.m:128
#24 0x00002b6e in main (argc=11, argv=0xbffff5bc) at /Volumes/HardDisk/Couchbase/TouchDB/Demo-iOS/main.m:17