hotspot/src/share/vm/prims/jvm.cpp
changeset 18025 b7bcf7497f93
parent 17826 9ad5cd464a75
child 18103 a17a8a4b7e5c
child 18066 b4b1f65075e5
--- a/hotspot/src/share/vm/prims/jvm.cpp	Fri Jun 07 09:33:01 2013 -0700
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Mon Jun 10 11:30:51 2013 +0200
@@ -59,6 +59,7 @@
 #include "services/attachListener.hpp"
 #include "services/management.hpp"
 #include "services/threadService.hpp"
+#include "trace/tracing.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/dtrace.hpp"
@@ -2999,6 +3000,8 @@
                              millis);
 #endif /* USDT2 */
 
+  EventThreadSleep event;
+
   if (millis == 0) {
     // When ConvertSleepToYield is on, this matches the classic VM implementation of
     // JVM_Sleep. Critical for similar threading behaviour (Win32)
@@ -3019,6 +3022,10 @@
       // An asynchronous exception (e.g., ThreadDeathException) could have been thrown on
       // us while we were sleeping. We do not overwrite those.
       if (!HAS_PENDING_EXCEPTION) {
+        if (event.should_commit()) {
+          event.set_time(millis);
+          event.commit();
+        }
 #ifndef USDT2
         HS_DTRACE_PROBE1(hotspot, thread__sleep__end,1);
 #else /* USDT2 */
@@ -3032,6 +3039,10 @@
     }
     thread->osthread()->set_state(old_state);
   }
+  if (event.should_commit()) {
+    event.set_time(millis);
+    event.commit();
+  }
 #ifndef USDT2
   HS_DTRACE_PROBE1(hotspot, thread__sleep__end,0);
 #else /* USDT2 */