summaryrefslogtreecommitdiff
path: root/src/VBox/Runtime/generic/timer-generic.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Runtime/generic/timer-generic.cpp
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Runtime/generic/timer-generic.cpp')
-rw-r--r--src/VBox/Runtime/generic/timer-generic.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/VBox/Runtime/generic/timer-generic.cpp b/src/VBox/Runtime/generic/timer-generic.cpp
index ab409c02..8e4c3270 100644
--- a/src/VBox/Runtime/generic/timer-generic.cpp
+++ b/src/VBox/Runtime/generic/timer-generic.cpp
@@ -116,7 +116,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_
int rc = RTSemEventCreate(&pTimer->Event);
if (RT_SUCCESS(rc))
{
- rc = RTThreadCreate(&pTimer->Thread, rtTimerThread, pTimer, 0, RTTHREADTYPE_TIMER, RTTHREADFLAGS_WAITABLE, "TIMER");
+ rc = RTThreadCreate(&pTimer->Thread, rtTimerThread, pTimer, 0, RTTHREADTYPE_TIMER, RTTHREADFLAGS_WAITABLE, "Timer");
if (RT_SUCCESS(rc))
{
*ppTimer = pTimer;
@@ -256,18 +256,15 @@ static DECLCALLBACK(int) rtTimerThread(RTTHREAD hThreadSelf, void *pvUser)
if (u64NanoTS >= pTimer->u64NextTS)
{
pTimer->iTick++;
- pTimer->pfnTimer(pTimer, pTimer->pvUser, pTimer->iTick);
-
- /* status changed? */
- if (pTimer->fSuspended || pTimer->fDestroyed)
- continue;
/* one shot? */
if (!pTimer->u64NanoInterval)
- {
ASMAtomicXchgU8(&pTimer->fSuspended, true);
+ pTimer->pfnTimer(pTimer, pTimer->pvUser, pTimer->iTick);
+
+ /* status changed? */
+ if (pTimer->fSuspended || pTimer->fDestroyed)
continue;
- }
/* calc the next time we should fire. */
pTimer->u64NextTS = pTimer->u64StartTS + pTimer->iTick * pTimer->u64NanoInterval;