Message9849

Author jmadden
Recipients jmadden, zyasoft
Date 2015-04-14.20:48:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429044540.18.0.423152769613.issue2328@psf.upfronthosting.co.za>
In-reply-to
Content
In the attached use-mutex-example-for-lock.patch, I tried the approach of using the Mutex example for Lock and sticking with ReentrantLock for RLock. There had to be a bit of abstraction introduced for Condition to work correctly. 

It's not the prettiest Java I've ever written, but at least as a proof-of-concept it seems to work. All the tests in test_threading and test_thread pass (along with as much of regrtest-unix as I can get through---my machine hangs out of files around test_httpservers and I haven't adjusted my ulimits yet). The only exception is the newly-enabled `test_notify` in test_threading.ConditionTests. Enabling that test was part of the earlier patch, but the code in Condition to implement `notify(n)` didn't make it in and I'm not 100% sure how to deal with overloaded methods yet so I didn't try to add it. 

(Also, the exposed name of RLock is coming out wrong right now and I don't yet know enough to fix it:

$ dist/bin/jython
imporJython 2.7rc2+ (default:5064a5c5b1a3+, Apr 14 2015, 15:38:48)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_40
Type "help", "copyright", "credits" or "license" for more information.
>>> import threading
>>> threading.RLock
<type 'org.python.modules._threading.RLock'>
>>> threading.Lock
<type '_threading.Lock'>
)
History
Date User Action Args
2015-04-14 20:49:00jmaddensetmessageid: <1429044540.18.0.423152769613.issue2328@psf.upfronthosting.co.za>
2015-04-14 20:49:00jmaddensetrecipients: + jmadden, zyasoft
2015-04-14 20:49:00jmaddenlinkissue2328 messages
2015-04-14 20:48:59jmaddencreate