In VFP, you have no threads. If one function (say, THISFORM.Button1.Click) is executing, then another function (say, THISFORM.Timer.Timer, or THISFORM.Button2.Click) starts to execute, the first function is paused until the second function concludes.
You can address the synchronization by placing a check at the beginning of the second function:
IF THISFORM.lSynchronizeLocked=.T.
RETURN .F.
ENDIF
to prevent another function from interrupting.
The only place VFP can truly multithread if running as a COM server built as an MTDLL. In that case, each COM object gets its own thread, and so THISFORM (or THIS) never points to the same object when referred to by two different threads, so something like THIS.lSynchronizeLocked can't work.
- Bill
Get the best answers to your questions -- See FAQ481-4875.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.