From 04d2611814dc656b82bf939144cecdbd54c036f6 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Tue, 21 Sep 2010 21:35:54 +0800 Subject: [PATCH] Add timeout of RW lock to avoid dead lock Signed-off-by: Frank Li --- src/Git/SharedMutex.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Git/SharedMutex.h b/src/Git/SharedMutex.h index d9e48f3c0..9d6290a64 100644 --- a/src/Git/SharedMutex.h +++ b/src/Git/SharedMutex.h @@ -41,12 +41,20 @@ public: ~SharedMutex(); // »ñÈ¡¹²Ïí·ÃÎÊȨ +#ifdef DEBUG bool AcquireShared(DWORD waitTime = INFINITE); +#else + bool AcquireShared(DWORD waitTime = 500); +#endif // ÊͷŹ²Ïí·ÃÎÊȨ void ReleaseShared(); // »ñÈ¡¶ÀÕ¼·ÃÎÊȨ +#ifdef DEBUG bool AcquireExclusive(DWORD waitTime = INFINITE); +#else + bool AcquireExclusive(DWORD waitTime = 500); +#endif // ÊͷŶÀÕ¼·ÃÎÊȨ void ReleaseExclusive(); }; -- 2.11.4.GIT