Semaphore.lock('lock1', 'lock2') do # code end