summaryrefslogtreecommitdiff
path: root/src/VBox/Runtime/generic/timer-generic.cpp
diff options
context:
space:
mode:
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;