android dalvik VM's thread state .

I got a  ANR  crash  ,  the  crash thread’s  state is  “MONITOR” which found in file traces_dut7_run3.txt(detail information :

DALVIK THREADS:

"main" prio=5 tid=3 MONITOR

| group="main" sCount=1 dsCount=0 s=N obj=0x40026240 self=0xbda8

| sysTid=26755 nice=0 sched=0/0 cgrp=unknown handle=-1344001376

at com.android.vending.api.RequestManager.reset(RequestManager.java:~273)

).

My question is what meaning the MONITOR state of  java thread ?

 

Only the following state “BLOCKED”, “NEW” , “RUNNABLE” ,”TERMINATED” , “TIMED_WAITING” , “WAITING” ,  not  “MONITOR”  were found   in Thread.java   at   page

 http://developer.android.com/reference/java/lang/Thread.State.html . 

However  the following state  "ZOMBIE", "RUNNABLE", "TIMED_WAIT", "MONITOR", "WAIT", "INITIALIZING", "STARTING", "NATIVE", "VMWAIT"  were found  

in  Thread.c  at page  http://lxr.e2g.org/source/dalvik/vm/Thread.c?a=sparc64#L2845 , but  no detail information  about  the state  in Thread.c   was  found  .

My  other question is  what  the corresponding relationship between  state in Thread.java  and state in Thread.c  at Android platform ?

 

 

ANSWER :

 

 

 

in android dalvik VM , at java.lang.VMThread.java , has following code .

 

 

      92     /**
     93      * Holds a mapping from native Thread statii to Java one. Required for
     94      * translating back the result of getStatus().
     95      */
     96     static final Thread.State[] STATE_MAP = new Thread.State[] {
     97         Thread.State.TERMINATED,     // ZOMBIE
     98         Thread.State.RUNNABLE,       // RUNNING
     99         Thread.State.TIMED_WAITING,  // TIMED_WAIT
    100         Thread.State.BLOCKED,        // MONITOR
    101         Thread.State.WAITING,        // WAIT
    102         Thread.State.NEW,            // INITIALIZING
    103         Thread.State.NEW,            // STARTING
    104         Thread.State.RUNNABLE,       // NATIVE
    105         Thread.State.WAITING         // VMWAIT
    106     };

 

So  MONITOR state  in Thread.c  is  BLOCKED state in Thread.java. They are same constant except name is different.

 

 

你可能感兴趣的:(java,thread,android,File,Crash)