The mutex is based off of the common Command design pattern, and the article walks through an implementation of ,a href="http://en.wikipedia.org/wiki/Lamport%27s_bakery_algorithm">Lamport's bakery algorithm</a>, which "works for multiple competing threads of control when the only communication between them is shared memory (i.e., no special mechanisms like semaphores, atomic set-and-test, etc. are required). The metaphor for this algorithm is a bakery that requires customers to take a number and wait until their number is called. The skeleton of the algorithm is in Listing 1 and it enables each thread to go into and out of critical sections without conflict."
From the article's conclusion:
With AJAX and RIA, the impetus to build complicated dynamic user interfaces is driving developers to use the same design patterns (e.g. Model-View-Controller) formerly tied to "fat" GUI clients. With Views and Controllers being defined modularly, each with their own events and event handlers (but sharing common data models), the potential for conflicts multiply. By encapsulating event handling logic into Command classes, not only can the Wallace variation be employed, but the stage is also set to provide rich undo/redo functionality, scripting interfaces, and unit test instrumentation.