]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/timercmn.cpp
corrected getting FSRef associated with the POSIX path in wxString
[wxWidgets.git] / src / common / timercmn.cpp
index ed6e8c00712af223cc91833a1346602818e59861..28f69dae3b5bb3fb21358e2feb2745e507c97b93 100644 (file)
@@ -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