diff --git a/src/io/pipeer.cpp b/src/io/pipeer.cpp index 00f5ed9d..5507b9fb 100755 --- a/src/io/pipeer.cpp +++ b/src/io/pipeer.cpp @@ -301,7 +301,6 @@ bool PIPeer::dataRead(uchar * readed, int size) { return true; } } - return true; } return true; } diff --git a/src/io/pipeer.h b/src/io/pipeer.h index d016bb04..17e6541c 100755 --- a/src/io/pipeer.h +++ b/src/io/pipeer.h @@ -119,8 +119,8 @@ public: const PeerInfo & selfInfo() const {return self_info;} const PIMap > & _peerMap() const {return addresses_map;} - void lock() {mc_mutex.lock();} - void unlock() {mc_mutex.unlock();} + void lock() {mc_mutex.lock(); eth_mutex.lock(); peers_mutex.lock();} + void unlock() {mc_mutex.unlock(); eth_mutex.unlock(); peers_mutex.unlock();} EVENT2(dataReceivedEvent, const PIString &, from, const PIByteArray &, data); EVENT1(peerConnectedEvent, const PIString &, name); diff --git a/utils/system_daemon/main.cpp b/utils/system_daemon/main.cpp index 2dc7e6df..410b81e6 100755 --- a/utils/system_daemon/main.cpp +++ b/utils/system_daemon/main.cpp @@ -123,6 +123,7 @@ public: } void updatePeerInfo() { screen.lock(); + daemon_.lock(); peers_tl->content.clear(); addrs_tl->content.clear(); peerinfo_tl->content.clear(); @@ -154,6 +155,7 @@ public: } piForeachC(PIString &s , peermap) peermap_tl->content << TileList::Row(s, CellFormat()); + daemon_.unlock(); screen.unlock(); } void tick(void* data_, int delimiter) { @@ -231,13 +233,13 @@ void tabConnect() { } int main(int argc, char * argv[]) { - //piDebug = false; + piDebug = false; PICLI cli(argc, argv); //cli.addArgument(""); sys_mon.startOnSelf(); screen.enableExitCapture(PIKbdListener::F10); MainMenu menu; - //screen.start(); + screen.start(); screen.waitForFinish(); //return 0; /*while (!PIKbdListener::exiting) {