Adobe Interview Question

How would I write a scoped mutex object? This was asked by their architect