X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/fed3bacaa7e5da92ab4cf44995b5a2bc26a81faa..eca2c8e0a8aad79c7dc7738346d265f973428995:/lcoremessages.pas diff --git a/lcoremessages.pas b/lcoremessages.pas index 8a2bd54..b67e4c0 100644 --- a/lcoremessages.pas +++ b/lcoremessages.pas @@ -389,7 +389,7 @@ var result64: integer; tv : ttimeval; begin - gettimeofday(tv); + gettimemonotonic(tv); result64 := (tv.tv_sec*1000)+(tv.tv_usec div 1000); result := result64; end; @@ -451,7 +451,7 @@ begin threaddata := findthreaddata(tm.GetCurrentThreadId); if threaddata.lcorethread then raise exception.create('get/peek message cannot be used in the lcore thread'); message := threaddata.messagequeue; - gettimeofday(nowtv); + gettimemonotonic(nowtv); while (not peek) and (message=nil) and (not tv_compare(nowtv,threaddata.nexttimer)) do begin threaddata.waiting := true; structurelock.release; @@ -461,7 +461,7 @@ begin timeouttv := threaddata.nexttimer; timeoutms := (timeouttv.tv_sec * 1000)+(timeouttv.tv_usec div 1000); - //i'm assuming the timeout is in milliseconds + //i am assuming the timeout is in milliseconds if (timeoutms > maxlongint) then timeoutms := maxlongint; threaddata.messageevent.waitfor(timeoutms); @@ -469,7 +469,7 @@ begin structurelock.acquire; threaddata.waiting := false; message := threaddata.messagequeue; - gettimeofday(nowtv); + gettimemonotonic(nowtv); end; if (message=nil) and tv_compare(nowtv,threaddata.nexttimer) then begin processtimers;