Re: [MOD] STR #3532: timeout set by Fl::add_timeout elapses too early

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.bugs  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [MOD] STR #3532: timeout set by Fl::add_timeout elapses too early Albrecht Schlosser Jan 20, 2020 top right image
 
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: https://www.fltk.org/str.php?L3532
Version: 1.3.5


Thanks for your comment.

Your comment is absolutely correct, but this would be some kind of
"undefined behavior" (and usage).

Basically the "missed_by" mechanism can only work correctly (as intended)
if you call Fl::repeat_timeout() with the same callback that triggered it -
otherwise 'missed_by' must be considered just a random (undefined) value.
Strictly spoken, the timeout you start with Fl::repeat_timeout() need not
be exactly the same callback but it must be directly related to the timeout
being served.

That said, Fl::repeat_timeout() must only be called

 (a) within a callback triggered by Fl::add/repeat_timeout and
 (b) with the same or a directly related timer

I believe the documentation needs to be clarified...

This is a task to be done in FLTK 1.4, hence I tend to close this STR w/o
backporting anything to FLTK 1.3.


Link: https://www.fltk.org/str.php?L3532
Version: 1.3.5


Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]
 
 

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