User Tools

Site Tools


action:Semaphore_Lock

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
action:Semaphore_Lock [2016/05/02 06:16]
alain cosmetic change
action:Semaphore_Lock [2016/06/24 16:32]
alain add forum link
Line 1: Line 1:
-The //Semaphore actions// (Lock, ​[[action:​Semaphore ​Unlock|Unlock]] ​and [[action:​Semaphore Reset|Reset]]) allow you to limit the execution of a sequence of actions.+The //Semaphore actions// (Lock, Unlock and Reset) allow you to limit the execution of a sequence of actions.
  
 When you trigger a macro, the Keyboard Maestro Engine takes a copy of it and starts executing it.  If you trigger another macro before the first one finishes, that will start executing as well - both will be executing more or less simultaneously. When you trigger a macro, the Keyboard Maestro Engine takes a copy of it and starts executing it.  If you trigger another macro before the first one finishes, that will start executing as well - both will be executing more or less simultaneously.
Line 11: Line 11:
 Occasionally there are cases where multiple macros are running simultaneously (or the same macro is running multiple times) and care needs to be taken that the sequences of actions are not intermixed. Occasionally there are cases where multiple macros are running simultaneously (or the same macro is running multiple times) and care needs to be taken that the sequences of actions are not intermixed.
  
-This is a primary purpose of using a //Semaphore Lock// - just place one at the start of the sequence. ​ The lock will remain in place (and any other macros that try to execute that action will have to wait) until the end of the macro, or until you execute a //[[action:Semaphore Unlock|Semaphore Unlock]]// or //​[[action:​Semaphore Reset|Semaphore Reset]]// ​action.+This is a primary purpose of using a //Semaphore Lock// - just place one at the start of the sequence. ​ The lock will remain in place (and any other macros that try to execute that action will have to wait) until the end of the macro, or until you execute a Semaphore Unlock action.
  
 The //Semaphore actions// take a name, and different names can be used for different (independent) locks. The //Semaphore actions// take a name, and different names can be used for different (independent) locks.
 +
 +Semaphore Lock can be balanced by a Semaphore Unlock, but a Semaphore is implicitly unlocked when the macro that locked it completes.
 +
 +Semaphore Reset will forcibly unlock a semaphore and should generally not be used except in very unusual circumstances.
  
 ===== See Also ===== ===== See Also =====
Line 30: Line 34:
  
 - [[https://​forum.keyboardmaestro.com/​t/​finish-executing-applescript-before-executing-key-commands/​1465/​3|Finish Executing AppleScript Before Executing Key Commands]] - [[https://​forum.keyboardmaestro.com/​t/​finish-executing-applescript-before-executing-key-commands/​1465/​3|Finish Executing AppleScript Before Executing Key Commands]]
 +- [[https://​forum.keyboardmaestro.com/​t/​how-is-a-semaphore-unlock-and-semaphore-reset-different/​4119|How is a "​Semaphore Unlock"​ and "​Semaphore Reset" different?​]]
  
 - [[https://​www.google.fr/​search?​q=site:​forum.keyboardmaestro.com+Semaphore+Lock+action|Keyboard Maestro Forum topics about Semaphore Lock action]] - [[https://​www.google.fr/​search?​q=site:​forum.keyboardmaestro.com+Semaphore+Lock+action|Keyboard Maestro Forum topics about Semaphore Lock action]]
action/Semaphore_Lock.txt ยท Last modified: 2022/10/30 21:42 by peternlewis