FLTK logo

[fltk.coredev] About mixing Fl::awake(Fl_Awake_Handler, void*) and Fl::awake(void*)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

About mixing Fl::awake(Fl_Awake_Handler, void*) and Fl::awake(void*) Manolo Jul 05, 2021  
 
Does any fellow developer know why the FLTK threading doc states :
"Don't intermix use of Fl::awake(Fl_Awake_Handler cb, void* userdata) and Fl::awake(void* message) calls in the same program as they may interact unpredictably on some platforms" ?

Do these platforms include Linux?

I'm asking because I'm exploring the use of Posix timers to implement Fl::add_timeout() 
for the Wayland platform (see the timer_create() and timer_settime() functions).
These functions allow to trigger the timer either as a signal or starting a thread.
I've chosen the thread option, and have the thread call Fl::awake(cb, data)
so that the timer's callback gets then called by the main thread in its event loop.

This solution works nicely in my tests, but has Fl::awake(cb, data) called by the library
when the app calls Fl::add_timeout(). Thus, a user of both Fl::add_timer()
and Fl::awake(void*) may find herself to intermix both forms of Fl::awake()
without knowing it if that solution is used to implement Wayland timers.

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/441fe510-b842-4a96-b858-dc505871fd09n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.