Fix potential deadlock
authorPieter Wuille <pieter.wuille@gmail.com>
Tue, 17 Apr 2012 16:50:45 +0000 (18:50 +0200)
committerPieter Wuille <pieter.wuille@gmail.com>
Tue, 17 Apr 2012 16:50:52 +0000 (18:50 +0200)
commitc581cc16bb5e490c0960ccf440de2d1e5f23c417
treee4cdaab6e956b05be9c103de92ea2b996d177575
parent7a5452ffb3075c0c2604a76e8e82c2c84a24e62e
Fix potential deadlock

Conflict:
* cs_main in ProcessMessages() (before calling ProcessMessages)
* cs_vSend in CNode::BeginMessage
versus:
* cs_vSend in ThreadMessageHandler2 (before calling SendMessages)
* cs_main in SendMessages

Even though cs_vSend is a try_lock, if it succeeds simultaneously with
the locking of cs_main in ProcessMessages(), it could cause a deadlock.
src/main.cpp