Home | History | Annotate | Download | only in util

Lines Matching refs:Thread

26 // The Profile class is used to collect profiling information for a thread. It
27 // samples stack traces for a thread periodically. enable() and disable() is
28 // used to enable and disable profiling for the calling thread. The profiling
39 // This is a watchdog entry for one thread.
40 // For every cycleTime period, we dump the stack of the thread.
42 Thread thread;
52 // This is a watchdog thread which dumps stacks of other threads periodically.
77 public synchronized void addWatchEntry(Thread thread, int cycleTime) {
79 e.thread = thread;
87 public synchronized void removeWatchEntry(Thread thread) {
89 if (mList.get(i).thread == thread) {
112 Thread thread = entry.thread;
126 Thread thread = entry.thread;
127 StackTraceElement[] stack = thread.getStackTrace();
139 private WatchEntry findEntry(Thread thread) {
142 if (entry.thread == thread) return entry;
155 public synchronized void hold(Thread t) {
159 // another thread). Same check is applied in commit() and drop()
166 public synchronized void commit(Thread t) {
177 public synchronized void drop(Thread t) {
185 // Enable profiling for the calling thread. Periodically (every cycleTimeInMs
186 // milliseconds) sample the stack trace of the calling thread.
188 Thread t = Thread.currentThread();
192 // Disable profiling for the calling thread.
194 sWatchdog.removeWatchEntry(Thread.currentThread());
212 // Hold the future samples coming from current thread until commit() or
216 sWatchdog.hold(Thread.currentThread());
220 sWatchdog.commit(Thread.currentThread());
224 sWatchdog.drop(Thread.currentThread());