Get thread count of current instance

Hi, I was wondering if there is a way to retrieve the thread count of the current instance/runtime without resulting in a security exception. I have tried code like: int nbRunning = 0; for (Thread t : Thread.getAllStackTraces().keySet()) { if (t.getState()==Thread.State.RUNNABLE) nbRunning++; } // and int thc = Thread.activeCount(); Thanks...
0 answers