lock (x) { // Your code... }