Message10033
Jim, I am afraid that Jython has to do something about it :) Please read carefully.
The issue is that the map is *not* a "weak-map" Thread -> PySystemState...
It is a "weak-map" Thread -> ThreadState
What is occurring is the following:
1. Py.setSystemState calls ThreadStateMapping.getThreadState
2. which is creating a ThreadState instance... that
3. *never gets* out of Py.setSystemState!!
4. As a local variable, it is garbage collected very early
5. The ThreadState is evicted from the "weak-map" since the value is GCed
6. Any time later, if I call Py.getSystemState, the "weak-map" does not find an entry for my thread
7. Py.getSystemState returns Py.defaultSystemState
So how do you want us to fix anything without a change in Jython?? I already keep a strong ref to the PySystemState... there's nothing I can do more outside of Jython. |
|
Date |
User |
Action |
Args |
2015-05-07 15:42:57 | JanVok | set | messageid: <1431013377.79.0.371838222472.issue2321@psf.upfronthosting.co.za> |
2015-05-07 15:42:57 | JanVok | set | recipients:
+ JanVok, zyasoft, kevinmcmurtrie |
2015-05-07 15:42:57 | JanVok | link | issue2321 messages |
2015-05-07 15:42:57 | JanVok | create | |
|