Message10683
This can likely be fixed by adjusting org.python.modules._io.Closer a bit (see our discussion at https://github.com/jythontools/jython/pull/30):
AtomicBoolean dismissed = new AtomicBoolean();
public void dismiss() {
if (dismissed.compareAndSet(false, true))
sys.unregisterCloser(this);
}
public synchronized Void call() {
if (dismissed.compareAndSet(false, true)) {
...
}
}
Note that dismiss does not need to be synchronized any more, still maintaining the old behavior. If Nick can confirm that this solves the issue, we can maybe get it already into beta 3 right now.
Later we should add a note to documentation of PySystemState.registerCloser and related API that Callable-implementors must not introduce their own locks because of deadlock risk. They rather should lock on PySystemStateCloser.class or use non-blocking locks like this AtomicBoolean variant. However I'd add this doc-stuff later for the RC. |
|
Date |
User |
Action |
Args |
2016-02-02 05:28:28 | stefan.richthofer | set | messageid: <1454390908.45.0.305159439205.issue2457@psf.upfronthosting.co.za> |
2016-02-02 05:28:28 | stefan.richthofer | set | recipients:
+ stefan.richthofer, zyasoft, nickmbailey |
2016-02-02 05:28:28 | stefan.richthofer | link | issue2457 messages |
2016-02-02 05:28:28 | stefan.richthofer | create | |
|