|
WaitOnBlitImageThread | |
Status = WaitOnBlitImageThread() | |
Parameters: NONE | |
Returns: Status = The Status code of wait. 1=Waited, 0 = failed |
|
The WaitOnBlitImageThread functions forces our program to wait until any previously threaded blitimage task has completed it's work, allows us to safely synchronize the main program with our secondary thread running on another CPU core . The function returns 0 when it didn't need to wait (failed) and a 1 when it had needed to wait.. When ever you use threading, then you should always call the WaitOnBlitImageThread function to make sure the thread has finished it's work. Don't assume that code that runs in parallel on your system (without wait), will operate the same on all computers, it won't ! So we always need to wait for our threads to complete. The most common usage of wait will be to synchronize our main program with the thread, where the main program is dependant upon the output of the thread. Either way, always wait ! For more information on threading see BlitImageThreadMode FACTS: * Threading is only supported on the BlitImage commands. * We recommend calling WaitOnBlitImageThread prior to calling END in programs that use threading. Since it's possible that our threaded job might fire up as our program is closing, which could cause a crash on exit. Same thing could occur if our program deletes an image a thread is using, while it's using it!. So some care is needed Example: |
|
Example Source: Download This Example
|
Related Info: | : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |