Thread - multithreading See also related modules . The optional list is passed as parameters to the subroutine.
Execution continues in both the subroutine and the code after the new call.
If the variable is locked by another thread, the lock call will block until it's available. If you really, really want locks to block access, then go ahead and tie them to something and manage this yourself. This is done on purpose. If a container object, such as a hash or array, is locked, all the elements of that container are not locked. Any calls to that sub from another thread will block until the lock is released.