diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2009-11-06 05:50:05 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2009-11-06 05:50:05 +0000 |
commit | 93cfb02acb13b74198b8e0ab72f039313ecf9f1f (patch) | |
tree | 87a748950637c99cca980d634ae499085777e2f0 /util.h | |
parent | fba40889418cb1861440a3fdccee048c69f0fb89 (diff) | |
download | bitcoin-93cfb02acb13b74198b8e0ab72f039313ecf9f1f.tar.xz |
got rid of CheckForShutdown, replaced some thread-unsafe wxWidgets calls, Linux fixes, socket send MSG_NOSIGNAL, bind INADDR_ANY, works reliably on Linux now except if wxMessageBox is used in a thread other than the GUI thread
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -84,6 +84,10 @@ inline void SetThreadPriority(int nThread, int nPriority) { setpriority(PRIO_PRO #define THREAD_PRIORITY_NORMAL 0
#define THREAD_PRIORITY_ABOVE_NORMAL 0
#endif
+#ifndef MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0
+#endif
+
@@ -379,6 +383,14 @@ inline int64 GetTimeMillis() return wxGetLocalTimeMillis().GetValue();
}
+inline string DateTimeStrFormat(const char* pszFormat, int64 nTime)
+{
+ time_t n = nTime;
+ struct tm* ptmTime = gmtime(&n);
+ char pszTime[200];
+ strftime(pszTime, sizeof(pszTime), pszFormat, ptmTime);
+ return pszTime;
+}
@@ -400,7 +412,7 @@ inline void heapchk() { \
static char nLoops; \
if (nLoops <= 0) \
- nLoops = GetRand(50) + 1; \
+ nLoops = GetRand(20) + 1; \
if (nLoops-- > 1) \
{ \
ThreadFn; \
|