New answers tagged

0

Your threadLocal prevents a thread from unlocking a lock taken by a different thread. That's not good, as there are legitimate uses for this scenario (some producer-consumer). What I also dislike is silently ignoring the unlock request. If it's forbidden, then it should probably throw. Anyway, you can what you did without any thread local just by using ...


Top 50 recent answers are included