Semaphore
Matlab has a waitfor function but it only works if you have a figure handle, leading to some somewhat out-of-place code if you want to use it with callbacks.
Semaphore.m is a simple wrapper around waitfor to make downstream code a little cleaner. To use it, create a Semaphore object. If this object is passed to an event handler or timer, then that handler can call Semaphore.Release() when it's finished.
If another thread as a Semaphore.Wait() call, it will wait until the respective Semaphore has been released.
Inspired by http://www.mathworks.com/matlabcentral/fileexchange/32489-semaphore, but I wanted something that didn't require an external library.
Citar como
Kevin Wang (2025). Semaphore (https://la.mathworks.com/matlabcentral/fileexchange/42910-semaphore), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
Etiquetas
Agradecimientos
Inspirado por: semaphore
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
