Fixed: #971 Another dead lock under Linux

This commit is contained in:
kervala 2010-06-09 20:12:27 +02:00
parent dc69bc2c73
commit e3cadf3de5
5 changed files with 10 additions and 10 deletions

View file

@ -56,7 +56,7 @@ using NLMISC::CSmartPtr;
using NLMISC::CRGBA;
using NLMISC::CVector;
using NLMISC::CMatrix;
using NLMISC::CSynchronized;
using NLMISC::CUnfairSynchronized;
class CMaterial;
@ -144,7 +144,7 @@ public:
protected:
CSynchronized<TTexDrvInfoPtrMap> _SyncTexDrvInfos;
CUnfairSynchronized<TTexDrvInfoPtrMap> _SyncTexDrvInfos;
TTexDrvSharePtrList _TexDrvShares;
TMatDrvInfoPtrList _MatDrvInfos;

View file

@ -50,7 +50,7 @@ IDriver::~IDriver()
// Must clean up everything before closing driver.
// Must doing this in release(), so assert here if not done...
{
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
nlassert( rTexDrvInfos.size() == 0 );
}
@ -81,7 +81,7 @@ bool IDriver::release(void)
// Release refptr of TextureDrvInfos. Should be all null (because of precedent pass).
{
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
// must be empty, because precedent pass should have deleted all.
@ -234,7 +234,7 @@ void IDriver::removeIBDrvInfoPtr(ItIBDrvInfoPtrList ibDrvInfoIt)
// ***************************************************************************
void IDriver::removeTextureDrvInfoPtr(ItTexDrvInfoPtrMap texDrvInfoIt)
{
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
rTexDrvInfos.erase(texDrvInfoIt);
@ -268,7 +268,7 @@ bool IDriver::invalidateShareTexture (ITexture &texture)
getTextureShareName (texture, name);
// Look for the driver info for this share name
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
TTexDrvInfoPtrMap::iterator iteDrvInfo = rTexDrvInfos.find (name);
if (iteDrvInfo != rTexDrvInfos.end())

View file

@ -549,7 +549,7 @@ bool CDriverD3D::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded
// insert or get the texture.
{
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
ItTexDrvInfoPtrMap itTex;
@ -1013,7 +1013,7 @@ bool CDriverD3D::isTextureExist(const ITexture&tex)
getTextureShareName (tex, name);
{
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
result = (rTexDrvInfos.find(name) != rTexDrvInfos.end());
}

View file

@ -720,7 +720,7 @@ bool CDriverGL::isTextureExist(const ITexture&tex)
getTextureShareName (tex, name);
{
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
result = (rTexDrvInfos.find(name) != rTexDrvInfos.end());
}

View file

@ -656,7 +656,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded,
// insert or get the texture.
{
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
CUnfairSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
ItTexDrvInfoPtrMap itTex;