298
299 /*
300 * Gets the number of objects pending for finalization.
301 *
302 * @return the number of objects pending for finalization.
303 */
304 public static int getFinalRefCount() {
305 return finalRefCount;
306 }
307
308 /*
309 * Gets the peak number of objects pending for finalization.
310 *
311 * @return the peak number of objects pending for finalization.
312 */
313 public static int getPeakFinalRefCount() {
314 return peakFinalRefCount;
315 }
316
317 /*
318 * Add <tt>n</tt> to the objects pending for finalization count.
319 *
320 * @param n an integer value to be added to the objects pending
321 * for finalization count
322 */
323 public static void addFinalRefCount(int n) {
324 // The caller must hold lock to synchronize the update.
325
326 finalRefCount += n;
327 if (finalRefCount > peakFinalRefCount) {
328 peakFinalRefCount = finalRefCount;
329 }
330 }
331
332 /**
333 * Returns Thread.State for the given threadStatus
334 */
335 public static Thread.State toThreadState(int threadStatus) {
336 if ((threadStatus & JVMTI_THREAD_STATE_RUNNABLE) != 0) {
337 return RUNNABLE;
338 } else if ((threadStatus & JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER) != 0) {
|
298
299 /*
300 * Gets the number of objects pending for finalization.
301 *
302 * @return the number of objects pending for finalization.
303 */
304 public static int getFinalRefCount() {
305 return finalRefCount;
306 }
307
308 /*
309 * Gets the peak number of objects pending for finalization.
310 *
311 * @return the peak number of objects pending for finalization.
312 */
313 public static int getPeakFinalRefCount() {
314 return peakFinalRefCount;
315 }
316
317 /*
318 * Add {@code n} to the objects pending for finalization count.
319 *
320 * @param n an integer value to be added to the objects pending
321 * for finalization count
322 */
323 public static void addFinalRefCount(int n) {
324 // The caller must hold lock to synchronize the update.
325
326 finalRefCount += n;
327 if (finalRefCount > peakFinalRefCount) {
328 peakFinalRefCount = finalRefCount;
329 }
330 }
331
332 /**
333 * Returns Thread.State for the given threadStatus
334 */
335 public static Thread.State toThreadState(int threadStatus) {
336 if ((threadStatus & JVMTI_THREAD_STATE_RUNNABLE) != 0) {
337 return RUNNABLE;
338 } else if ((threadStatus & JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER) != 0) {
|