The 3
event scripts (boot_init.txt, autoexec.bat, onxmb.bat) are not designed to interact between them. They run in an individual thread. Therefore I don't think we need a semaphore to stop the processing of the other plugin threads.
Once the thread for the event script is created, the internal methods are called within that thread (except the ones that create new threads like refresh XML). So the script commands run sequentially.
onxmb.bat waits until 30 seconds for explore_plugin before start the processing. The others run immediately.
To synchronize the scripts with other system processes the script uses wait and lwait.
- wait <n> - waits n seconds. n can be between 1 and 255.
- wait xmb - waits for xmb until 30 seconds
- wait <file> - waits up to 5 seconds until a file exists
- lwait <file> - waits up to 10 seconds until a file exists
A sys_ppu_thread_yield() is performed internally on each wait call. The purpose is to give more processing time to other threads while the current thread is waiting.
If you have any idea that could improve this system, they are welcome