Java 类soot.jimple.toolkits.thread.AbstractRuntimeThread 实例源码

项目:JAADAS    文件:SynchObliviousMhpAnalysis.java   
public SynchObliviousMhpAnalysis()
{
    threadList = new ArrayList<AbstractRuntimeThread>();
    optionPrintDebug = false;

    self = null;

    buildThreadList();
}
项目:JAADAS    文件:SynchObliviousMhpAnalysis.java   
public void printMhpSummary()
{
    if(optionThreaded)
    {
        if(self == null)
            return; // not run... do nothing

        // Wait until finished
        G.v().out.println("[mhp] waiting for thread to finish");
        try
        {
            self.join();
        }
        catch(InterruptedException ie)
        {
            return;
        }
    }

    List<AbstractRuntimeThread> threads = new ArrayList<AbstractRuntimeThread>();
    int size = threadList.size();
    G.v().out.println("[mhp]");
    for(int i = 0; i < size; i++)
    {
        if( !threads.contains(threadList.get(i)) )
        {
            G.v().out.println("[mhp] " + 
                threadList.get(i).toString().replaceAll(
                    "\n", "\n[mhp] ").replaceAll(
                    ">,",">\n[mhp]  "));
            G.v().out.println("[mhp]");
        }
        threads.add(threadList.get(i));
    }
}
项目:JAADAS    文件:SynchObliviousMhpAnalysis.java   
public List<SootClass> getThreadClassList()
{
    if(optionThreaded)
    {
        if(self == null)
            return null; // not run... do nothing

        // Wait until finished
        G.v().out.println("[mhp] waiting for thread to finish");
        try
        {
            self.join();
        }
        catch(InterruptedException ie)
        {
            return null;
        }
    }

    if(threadList == null)
        return null;

    List<SootClass> threadClasses = new ArrayList<SootClass>();
    int size = threadList.size();
    for(int i = 0; i < size; i++)
    {
        AbstractRuntimeThread thread = threadList.get(i);
        Iterator<Object> threadRunMethodIt = thread.getRunMethods().iterator();
        while(threadRunMethodIt.hasNext())
        {
            SootClass threadClass = ((SootMethod) threadRunMethodIt.next()).getDeclaringClass(); // what about subclasses???
            if( !threadClasses.contains(threadClass) && threadClass.isApplicationClass() ) // only include application threads
                threadClasses.add(threadClass);
        }
    }
    return threadClasses;
}
项目:JAADAS    文件:SynchObliviousMhpAnalysis.java   
public List<AbstractRuntimeThread> getThreads()
{
    if(optionThreaded)
    {
        if(self == null)
            return null; // not run... do nothing

        // Wait until finished
        G.v().out.println("[mhp] waiting for thread to finish");
        try
        {
            self.join();
        }
        catch(InterruptedException ie)
        {
            return null;
        }
    }

    if(threadList == null)
        return null;

    List<AbstractRuntimeThread> threads = new ArrayList<AbstractRuntimeThread>();
    int size = threadList.size();
    for(int i = 0; i < size; i++)
    {
        if( !threads.contains(threadList.get(i)) )
        {
            threads.add(threadList.get(i));
        }
    }
    return threads;
}
项目:JAADAS    文件:MhpTester.java   
public List<AbstractRuntimeThread> getThreads();