corrected deadlock

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.4.x@1856 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-11-30 21:27:50 +00:00
parent fc9e86c6a7
commit 79eccf3d6a
2 changed files with 8 additions and 7 deletions

View File

@ -142,15 +142,14 @@ int RsServer::UpdateAllConfig()
/* Notify of Changes */ /* Notify of Changes */
// iface.setChanged(RsIface::Config); // iface.setChanged(RsIface::Config);
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_CONFIG, NOTIFY_TYPE_MOD);
/* unlock Mutexes */ /* unlock Mutexes */
iface.unlockData(); /* UNLOCK */ iface.unlockData(); /* UNLOCK */
unlockRsCore(); /* UNLOCK */ unlockRsCore(); /* UNLOCK */
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_CONFIG, NOTIFY_TYPE_MOD);
return 1; return 1;
} }
void RsServer::ConfigFinalSave() void RsServer::ConfigFinalSave()

View File

@ -467,22 +467,24 @@ void upnphandler::restart()
bool upnphandler::getEnabled() bool upnphandler::getEnabled()
{ {
dataMtx.lock(); /*** LOCK MUTEX ***/ // no need to lock for reading a boolean
// dataMtx.lock(); /*** LOCK MUTEX ***/
bool on = toEnable; bool on = toEnable;
dataMtx.unlock(); /*** UNLOCK MUTEX ***/ // dataMtx.unlock(); /*** UNLOCK MUTEX ***/
return on; return on;
} }
bool upnphandler::getActive() bool upnphandler::getActive()
{ {
dataMtx.lock(); /*** LOCK MUTEX ***/ // no need to lock for reading a boolean
// dataMtx.lock(); /*** LOCK MUTEX ***/
bool on = (upnpState == RS_UPNP_S_ACTIVE); bool on = (upnpState == RS_UPNP_S_ACTIVE);
dataMtx.unlock(); /*** UNLOCK MUTEX ***/ // dataMtx.unlock(); /*** UNLOCK MUTEX ***/
return on; return on;
} }