X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Futil.cpp;h=03b3d73e6218e682a632d77c6e3703584860e8ef;hb=0a70a3f4d88ad8e4ab689bacff4eda0cdfa88e65;hp=3c53771baffabb4245fc9032176a33f3a703b4dd;hpb=0aca8577b55d218f72c7383b2464ca07b7f77d0d;p=novacoin.git diff --git a/src/util.cpp b/src/util.cpp index 3c53771..03b3d73 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -921,16 +921,22 @@ string FormatFullVersion() struct CLockLocation { - std::string mutexName; - std::string sourceFile; - int sourceLine; - CLockLocation(const char* pszName, const char* pszFile, int nLine) { mutexName = pszName; sourceFile = pszFile; sourceLine = nLine; } + + std::string ToString() const + { + return mutexName+" "+sourceFile+":"+itostr(sourceLine); + } + +private: + std::string mutexName; + std::string sourceFile; + int sourceLine; }; typedef std::vector< std::pair > LockStack; @@ -948,14 +954,14 @@ static void potential_deadlock_detected(const std::pairsecond; + printf("Unlocked: %s\n", locklocation.ToString().c_str()); + } + dd_mutex.lock(); (*lockstack).pop_back(); + dd_mutex.unlock(); } void CCriticalSection::Enter(const char* pszName, const char* pszFile, int nLine)