Recent

Author Topic: Wait for multiple events  (Read 861 times)

alpine

  • Hero Member
  • *****
  • Posts: 1315
Wait for multiple events
« on: September 01, 2024, 11:08:58 pm »
Hi,

Is there a portable way to wait for multiple TEventObject without using an OS-specific call such as e.g. WaitForMultipleObjects?

Thanks in advance!
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

Wallaby

  • Full Member
  • ***
  • Posts: 104
Re: Wait for multiple events
« Reply #1 on: September 02, 2024, 01:02:52 pm »
Nope. And apparently there is no easy way to do it, I have checked in Delphi, waiting for multiple events is only available for Windows.


Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1265
Re: Wait for multiple events
« Reply #2 on: September 02, 2024, 01:15:10 pm »
Hi,

Is there a portable way to wait for multiple TEventObject without using an OS-specific call such as e.g. WaitForMultipleObjects?

Thanks in advance!

I’m curious what controls you are working with ?
« Last Edit: September 02, 2024, 06:01:56 pm by Joanna »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

Thaddy

  • Hero Member
  • *****
  • Posts: 16312
  • Censorship about opinions does not belong here.
Re: Wait for multiple events
« Reply #3 on: September 02, 2024, 03:14:30 pm »
There are several ways to simulate it though, using pthread mutexes, but also through this library:
https://github.com/NeoSmart/PEvents
which looks like being able to be translated/flattened to FreePascal for Posix platforms.
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018