JetBrains interview question

What is a lock