From e3cadf3de51c7281d83cfccda2ee71782e0da04f Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 9 Jun 2010 20:12:27 +0200 Subject: [PATCH] Fixed: #971 Another dead lock under Linux --- code/nel/include/nel/3d/driver.h | 4 ++-- code/nel/src/3d/driver.cpp | 8 ++++---- .../src/3d/driver/direct3d/driver_direct3d_texture.cpp | 4 ++-- code/nel/src/3d/driver/opengl/driver_opengl.cpp | 2 +- code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/nel/include/nel/3d/driver.h b/code/nel/include/nel/3d/driver.h index 21ca5b079..a4957f8ce 100644 --- a/code/nel/include/nel/3d/driver.h +++ b/code/nel/include/nel/3d/driver.h @@ -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 _SyncTexDrvInfos; + CUnfairSynchronized _SyncTexDrvInfos; TTexDrvSharePtrList _TexDrvShares; TMatDrvInfoPtrList _MatDrvInfos; diff --git a/code/nel/src/3d/driver.cpp b/code/nel/src/3d/driver.cpp index af6ad6c07..063823433 100644 --- a/code/nel/src/3d/driver.cpp +++ b/code/nel/src/3d/driver.cpp @@ -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::CAccessor access(&_SyncTexDrvInfos); + CUnfairSynchronized::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::CAccessor access(&_SyncTexDrvInfos); + CUnfairSynchronized::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::CAccessor access(&_SyncTexDrvInfos); + CUnfairSynchronized::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::CAccessor access(&_SyncTexDrvInfos); + CUnfairSynchronized::CAccessor access(&_SyncTexDrvInfos); TTexDrvInfoPtrMap &rTexDrvInfos = access.value(); TTexDrvInfoPtrMap::iterator iteDrvInfo = rTexDrvInfos.find (name); if (iteDrvInfo != rTexDrvInfos.end()) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp index 0c10a3eb8..0eed232ca 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp @@ -549,7 +549,7 @@ bool CDriverD3D::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded // insert or get the texture. { - CSynchronized::CAccessor access(&_SyncTexDrvInfos); + CUnfairSynchronized::CAccessor access(&_SyncTexDrvInfos); TTexDrvInfoPtrMap &rTexDrvInfos = access.value(); ItTexDrvInfoPtrMap itTex; @@ -1013,7 +1013,7 @@ bool CDriverD3D::isTextureExist(const ITexture&tex) getTextureShareName (tex, name); { - CSynchronized::CAccessor access(&_SyncTexDrvInfos); + CUnfairSynchronized::CAccessor access(&_SyncTexDrvInfos); TTexDrvInfoPtrMap &rTexDrvInfos = access.value(); result = (rTexDrvInfos.find(name) != rTexDrvInfos.end()); } diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index be6048d5c..faf2d538d 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -720,7 +720,7 @@ bool CDriverGL::isTextureExist(const ITexture&tex) getTextureShareName (tex, name); { - CSynchronized::CAccessor access(&_SyncTexDrvInfos); + CUnfairSynchronized::CAccessor access(&_SyncTexDrvInfos); TTexDrvInfoPtrMap &rTexDrvInfos = access.value(); result = (rTexDrvInfos.find(name) != rTexDrvInfos.end()); } diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp index 4d4166591..0acd2c57d 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp @@ -656,7 +656,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, // insert or get the texture. { - CSynchronized::CAccessor access(&_SyncTexDrvInfos); + CUnfairSynchronized::CAccessor access(&_SyncTexDrvInfos); TTexDrvInfoPtrMap &rTexDrvInfos = access.value(); ItTexDrvInfoPtrMap itTex;