| Create a new LockedExecutor that relies on the given mutual
exclusion lock.
Parameters: mutex - Any mutual exclusion lock.Standard usage is to supply an instance of Mutex ,but, for example, a Semaphore initialized to 1 also works.On the other hand, many other Sync implementations would notwork here, so some care is required to supply a sensible synchronization object. |