Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6260b83 authored by John Reck's avatar John Reck
Browse files

Fix nano vs. millis

Change-Id: I54f752bb7faab5fa66c36252c9f7cf8f5c9939c9
parent e0d1e295
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public:
    ANDROID_API virtual void run() = 0;

    RenderTask* mNext;
    nsecs_t mRunAt;
    nsecs_t mRunAt; // nano-seconds on the SYSTEM_TIME_MONOTONIC clock
};

class SignalingRenderTask : public RenderTask {
+3 −2
Original line number Diff line number Diff line
@@ -128,7 +128,8 @@ bool RenderThread::threadLoop() {
        if (nextWakeup == LLONG_MAX) {
            timeoutMillis = -1;
        } else {
            timeoutMillis = nextWakeup - systemTime(SYSTEM_TIME_MONOTONIC);
            nsecs_t timeoutNanos = nextWakeup - systemTime(SYSTEM_TIME_MONOTONIC);
            timeoutMillis = nanoseconds_to_milliseconds(timeoutNanos);
            if (timeoutMillis < 0) {
                timeoutMillis = 0;
            }
@@ -149,7 +150,7 @@ void RenderThread::queue(RenderTask* task) {

void RenderThread::queueDelayed(RenderTask* task, int delayMs) {
    nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
    task->mRunAt = now + delayMs;
    task->mRunAt = now + milliseconds_to_nanoseconds(delayMs);
    queue(task);
}