We're updating the issue view to help you get more done. 

Waiting on a lock that should raise illegal monitor state exception will actual fail on an assert

Description

If you wait on an object without first holding its lock then an illegal monitor state exception should occur. When we wait we get the heavy weight lock, creating it if none existing. The inflate process that creates the lock first asserts that the owner of the lock is the current thread. This assert will fail rather than giving the expected illegal monitor state exception.

The fix is to first check an object holds a lock (failing with illegal monitor state if it doesn't) before acquiring a heavy lock for the object.

Environment

None

Status

Assignee

Unassigned

Reporter

Ian Rogers

Labels

None

External issue ID

None

Fix versions

Priority

Medium