X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Futil.cpp;h=7354df6e734d6e668d0c1d3a9f6d0ed525c464d0;hb=a20c0d0f6792acf532309eee2e9f29120c801ee4;hp=cf73ecf5a503aa88ec3be6d8b096d4b65aa87c6f;hpb=52d3a48128b66e731afd54cec7cab0a687d303cf;p=novacoin.git diff --git a/src/util.cpp b/src/util.cpp index cf73ecf..7354df6 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -33,16 +33,6 @@ bool fNoListen = false; bool fLogTimestamps = false; CMedianFilter vTimeOffsets(200,0); - - -// Workaround for "multiple definition of `_tls_used'" -// http://svn.boost.org/trac/boost/ticket/4258 -extern "C" void tss_cleanup_implemented() { } - - - - - // Init openssl library multithreading support static boost::interprocess::interprocess_mutex** ppmutexOpenSSL; void locking_callback(int mode, int i, const char* file, int line) @@ -1041,7 +1031,7 @@ void AddTimeData(const CNetAddr& ip, int64 nTime) string strMessage = _("Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."); strMiscWarning = strMessage; printf("*** %s\n", strMessage.c_str()); - boost::thread(boost::bind(ThreadSafeMessageBox, strMessage+" ", string("Bitcoin"), wxOK | wxICON_EXCLAMATION, (wxWindow*)NULL, -1, -1)); + ThreadSafeMessageBox(strMessage+" ", string("Bitcoin"), wxOK | wxICON_EXCLAMATION); } } } @@ -1071,12 +1061,7 @@ string FormatVersion(int nVersion) string FormatFullVersion() { - string s = FormatVersion(CLIENT_VERSION); - if (VERSION_IS_BETA) { - s += "-"; - s += _("beta"); - } - return s; + return CLIENT_BUILD; } // Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014) @@ -1193,62 +1178,14 @@ static void pop_lock() dd_mutex.unlock(); } -void CCriticalSection::Enter(const char* pszName, const char* pszFile, int nLine) +void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs) { - push_lock(this, CLockLocation(pszName, pszFile, nLine)); -#ifdef DEBUG_LOCKCONTENTION - bool result = mutex.try_lock(); - if (!result) - { - printf("LOCKCONTENTION: %s\n", pszName); - printf("Locker: %s:%d\n", pszFile, nLine); - mutex.lock(); - printf("Locked\n"); - } -#else - mutex.lock(); -#endif + push_lock(cs, CLockLocation(pszName, pszFile, nLine)); } -void CCriticalSection::Leave() -{ - mutex.unlock(); - pop_lock(); -} -bool CCriticalSection::TryEnter(const char* pszName, const char* pszFile, int nLine) -{ - push_lock(this, CLockLocation(pszName, pszFile, nLine)); - bool result = mutex.try_lock(); - if (!result) pop_lock(); - return result; -} - -#else -void CCriticalSection::Enter(const char* pszName, const char* pszFile, int nLine) +void LeaveCritical() { -#ifdef DEBUG_LOCKCONTENTION - bool result = mutex.try_lock(); - if (!result) - { - printf("LOCKCONTENTION: %s\n", pszName); - printf("Locker: %s:%d\n", pszFile, nLine); - mutex.lock(); - } -#else - mutex.lock(); -#endif -} - -void CCriticalSection::Leave() -{ - mutex.unlock(); -} - -bool CCriticalSection::TryEnter(const char*, const char*, int) -{ - bool result = mutex.try_lock(); - return result; + pop_lock(); } #endif /* DEBUG_LOCKORDER */ -