This content has been marked as final. Show 1 reply
That's because each thread is invoking the method on a unique personal instance of SyncClass. There is nothing shared between the two threads; thread T1 will put a lock on its own instance of SyncClass and Thread T2 will put a lock on its own instance of SyncClass; they won't ever see each other's locks.
Try modifying your code such that the threads call synMthd on the exact same instance of SyncClass because that's when things are likely to go boom when concurrently running code.
And btw: use \
tags to post code to make it readable.