X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/79654e256bc6ee918cd15a6ec1c60c6bada8a6e8..07157c53d001f596d48d7e2281af7f4d013b0d72:/src/common/timercmn.cpp diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp index ed6e8c0071..28f69dae3b 100644 --- a/src/common/timercmn.cpp +++ b/src/common/timercmn.cpp @@ -36,6 +36,7 @@ #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/thread.h" #endif #include "wx/timer.h" @@ -131,6 +132,13 @@ void wxTimerBase::Notify() bool wxTimerBase::Start(int milliseconds, bool oneShot) { + // under MSW timers only work when they're started from the main thread so + // let the caller know about it +#if wxUSE_THREADS + wxASSERT_MSG( wxThread::IsMain(), + _T("timer can only be started from the main thread") ); +#endif // wxUSE_THREADS + if ( IsRunning() ) { // not stopping the already running timer might work for some @@ -350,6 +358,7 @@ wxLongLong wxGetLocalTimeMillis() millival += upTime.lo / 1000 ; millival += ( ( (UInt64) upTime.hi ) << 32 ) / 1000 ; val = millival ; + return val ; #else // no gettimeofday() nor ftime() // We use wxGetLocalTime() to get the seconds since // 00:00:00 Jan 1st 1970 and then whatever is available