Ticket #116 (closed defect: wontfix)
Opened 11 years ago
Deadlock with synchronized block
| Reported by: | Bernhard Haumacher (haui at haumacher dot de) | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.07a |
| Component: | JP environment | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Using a single remote reference as expression in a synchronized block for synchronization and signaling causes a dead-lock. This does only occur, if the expression has Object compile-time type.
Evaluation
If the locking expression in a synchronized block has Object compile-time type, this object may either be a remote object reference or a local object at runtime. In this case, remote synchronization must be tried using _enter() and _exit() calls, and local synchronization must be performed as well. If at runtime the object is a remote reference, remote and local locking applies. If the thread owning these both locks now decides to wait() on the remote object, it still owns the local lock on the remote reference. Therefore this remote reference can not be used in another remote thread to acquire the remote lock and send the signal. Instead a dead-lock occurs if no other thread can send the signal using another remote reference or calling a synchronized remote method.
Evaluation
This bug is reported again as ticket:136 that is already fixed. The problem is described more clearly there, so this bug can be closed.
See also
ticket:117, ticket:136, ticket:204
Test
jp.test.TestSyncBlock
closed since 1.07a.
