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 */
// iface.setChanged(RsIface::Config);
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_CONFIG, NOTIFY_TYPE_MOD);
/* unlock Mutexes */
iface.unlockData(); /* UNLOCK */
unlockRsCore(); /* UNLOCK */
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_CONFIG, NOTIFY_TYPE_MOD);
return 1;
}
void RsServer::ConfigFinalSave()

View File

@ -467,22 +467,24 @@ void upnphandler::restart()
bool upnphandler::getEnabled()
{
dataMtx.lock(); /*** LOCK MUTEX ***/
// no need to lock for reading a boolean
// dataMtx.lock(); /*** LOCK MUTEX ***/
bool on = toEnable;
dataMtx.unlock(); /*** UNLOCK MUTEX ***/
// dataMtx.unlock(); /*** UNLOCK MUTEX ***/
return on;
}
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);
dataMtx.unlock(); /*** UNLOCK MUTEX ***/
// dataMtx.unlock(); /*** UNLOCK MUTEX ***/
return on;
}