docs on TThread.Synchronize, TThread.Queu, Chechsynchronize, and WakeMainThread
Original Reporter info from Mantis: mschnell
-
Reporter name: Michael Schnell
Original Reporter info from Mantis: mschnell
- Reporter name: Michael Schnell
Description:
As I am not familiar with the appropriate tools and the proceedings, I'd like to request a knowledgeable person to enhance the docs for some RTL functions that might get rather important to me in the future:
IMHO this is not a documentation at all but just a vague hit on how this function might be used.
I think a more appropriate description could be similar to:
CheckSynchronize checks if there are entries in the event queue, pulls them and fires events (aka callbacks) for each of them until the event queue is empty.
The Events, CheckSynchronize pulls from the queue, have been generated by TThread.Synchronize and TThread.Queue calls.
Calling CheckSynchronize is only allowed in the Main thread, but not in worker threads generated by TThread siblings.
If the event queue is empty, CheckSynchronize waits for an event to be pushed (and it is notified of that via "WakeMainThread") by a TThread or for timeout Milliseconds to pass. If timeout is 0 (or not given), it does not wait, but returns after all events have been handled.
--- It should be documented whether or not the function returns if some events have been handled but the timeout did not hit or if it goes on waiting for the timeout. I don't know if this is the case. ----
CheckSynchronize should be called regularly by the main application thread to handle any TThread.Synchronize and TThread.Queue calls that may be waiting for execution by the main thread.
WakeMainThread is called by the TThread.synchronize and the TThread.Queue call, To notify the Mainthread that might be waiting for such events within a CheckSynchronize() call.
,,,,
(In fact I don't really understand the rest of the text, but that might be my own silliness. Of course I do know exactly what WakeMainThread is supposed to do.)
- The function Synchronize is missing even though http://www.freepascal.org/docs-html/rtl/classes/checksynchronize.html links here on that behalf
- the function Queue is missing (which of course has been implemented only recently)
Thanks,
-Michael
Steps to reproduce:
http://www.freepascal.org/docs-html/rtl/classes/checksynchronize.html
http://www.freepascal.org/docs-html/rtl/classes/wakemainthread.html
http://www.freepascal.org/docs-html/rtl/classes/tthread.html
Mantis conversion info:
- Mantis ID: 25056
- OS: all
- OS Build: all
- Build: all
- Platform: all
- Version: 2.6.3
- Fixed in version: 3.0.0
- Fixed in revision: 1026 (#6fb0e3ff)
- Target version: 3.0.0