How do you synchronize a block of code inside a method?
lock(this)
synchronize(this)
synchronized(this) { /* code */ }
Thread.lock(this) {}
This question is part of this quiz :