Recent

Author Topic: WaitForRTLEvent signaled status?  (Read 176 times)

RDP1974

  • New member
  • *
  • Posts: 9
WaitForRTLEvent signaled status?
« on: August 02, 2019, 12:20:30 am »
hi,

I wait for a TRTLEvent inside a thread using WaitForRTLEvent(event, timeout), under Linux.

On win32 the function can retun wsAbandoned, wsTimeout, wsError.

Under Linux how to get the timeout signal?

I tried with errno=ETimeout, without success.

I tried casting pintrtlevent.isset boolean, without success.

Any hint?

Else will use a GetTickCount before and after.

jamie

  • Hero Member
  • *****
  • Posts: 1897
Re: WaitForRTLEvent signaled status?
« Reply #1 on: August 02, 2019, 12:25:55 am »
In Windows the define is "WAIT_TIMEOUT" so if the wait function returns that instead of 0 then it timed out.

if it returns -1 then there was an error.

kapibara

  • Hero Member
  • *****
  • Posts: 511
Re: WaitForRTLEvent signaled status?
« Reply #2 on: August 02, 2019, 02:49:22 am »
Search for RTLEvent here in the forum, lots of info.

Maybe this example is what you look for:
https://forum.lazarus.freepascal.org/index.php/topic,37290.msg250381.html#msg250381
Lazarus trunk / fpc 3.0.4 / Debian Stretch 64-bit