From: <pcm...@us...> - 2008-05-15 05:14:44
|
Revision: 847 http://javapathfinder.svn.sourceforge.net/javapathfinder/?rev=847&view=rev Author: pcmehlitz Date: 2008-05-14 22:14:41 -0700 (Wed, 14 May 2008) Log Message: ----------- * revamped interrupt handling - interrupt status is actually more of a flag on the model side than it is a ThreadInfo state. We still keep the INTERRUPTED state, but mostly for symmetry reasons (in analogy to NOTIFIED or TIMEDOUT, i.e. representing a WAIT end condition), maybe it will go away (but make sure of proper interrupt notification in this case!). The UNBLOCKED_INTERRUPT state is gone - waiters that got interrupted now either go to to BLOCKED (if they can't re-acquire the lock), or to UNBLOCKED (if they can), and we use the model field to determine if we have to throw an InterruptedException coming out of the wait. Going into the wait, we skip the CG if there is a pending interrupt and directly throw. Since interrupt() changes thread status, we turn it into a SchedulingPoint - this might cause some more states, but they are required (other theads might become runnable at this point). The model flag carries some speed penalties, maybe we have to move/shadow it to native, but w/o loosing backtrackability (what a word!) This seems this solves Oksana's ThreadPoolTest example (java.util.concurrent.ExecutorService) Still need to add the test cases tomorrow * also finally added Elena's ThreadInfo.createThreadInfo() fix to prevent multiple occurrences of the same ThreadInfo in the ThreadList (which is another relict) - thanks Elena Modified Paths: -------------- branches/v5/env/jpf/java/lang/Thread.java branches/v5/env/jvm/gov/nasa/jpf/jvm/JPF_java_lang_Object.java branches/v5/env/jvm/gov/nasa/jpf/jvm/JPF_java_lang_Thread.java branches/v5/env/jvm/gov/nasa/jpf/jvm/JPF_sun_misc_Unsafe.java branches/v5/src/gov/nasa/jpf/jvm/DefaultSchedulerFactory.java branches/v5/src/gov/nasa/jpf/jvm/ElementInfo.java branches/v5/src/gov/nasa/jpf/jvm/JVM.java branches/v5/src/gov/nasa/jpf/jvm/Monitor.java branches/v5/src/gov/nasa/jpf/jvm/SchedulerFactory.java branches/v5/src/gov/nasa/jpf/jvm/ThreadInfo.java branches/v5/src/gov/nasa/jpf/jvm/choice/ThreadChoiceFromSet.java This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |