JetBrains Interview Question

What is a lock