lock asynchronous resources