3 ms·
> Neither Go, Java or C++ would catch that concurrency bug. That is incorrect. Java enforces that a monitor lock (or Lock) must be released by the same thread
by lenkite 1y ago
> Neither Go, Java or C++ would catch that concurrency bug.
That is incorrect. Java enforces that a monitor lock (or Lock) must be released by the same thread that acquired it. Attempting to unlock from a different thread throws IllegalMonitorStateException.
- rapsey 1y agoAt runtime instead of compile time, which is the point of the thread.