Message10028

Author JanVok
Recipients JanVok, kevinmcmurtrie, zyasoft
Date 2015-05-07.12:01:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1431000119.82.0.634356460255.issue2321@psf.upfronthosting.co.za>
In-reply-to
Content
Hello! This bug is biting my application which uses Py.setSystemState(). I was wondering what would be the best fix and I wonder if the following would be OK:

We change the code to be that of msg9795 (no weak values) but then we store the provided *PySystemState* to a WeakReference with a ReferenceQueue.

And then we use the associated ReferenceQueue to detect when the PySystemState is garbage collected so that we can remove the associated ThreadState from the map...

BTW, I was never really clear whether sharing the PySystemState between two threads was safe or not (this is where documenting the API would be helpful!).
History
Date User Action Args
2015-05-07 12:01:59JanVoksetmessageid: <1431000119.82.0.634356460255.issue2321@psf.upfronthosting.co.za>
2015-05-07 12:01:59JanVoksetrecipients: + JanVok, zyasoft, kevinmcmurtrie
2015-05-07 12:01:59JanVoklinkissue2321 messages
2015-05-07 12:01:59JanVokcreate