Mercurial > hg > truffle
comparison src/share/vm/prims/jvm.cpp @ 11020:3a0774193f71
Merge
author | chegar |
---|---|
date | Wed, 19 Jun 2013 11:02:10 +0100 |
parents | eaf3742822ec f2110083203d |
children | 9f3e3245b50f |
comparison
equal
deleted
inserted
replaced
11019:eaf3742822ec | 11020:3a0774193f71 |
---|---|
57 #include "runtime/vframe.hpp" | 57 #include "runtime/vframe.hpp" |
58 #include "runtime/vm_operations.hpp" | 58 #include "runtime/vm_operations.hpp" |
59 #include "services/attachListener.hpp" | 59 #include "services/attachListener.hpp" |
60 #include "services/management.hpp" | 60 #include "services/management.hpp" |
61 #include "services/threadService.hpp" | 61 #include "services/threadService.hpp" |
62 #include "trace/tracing.hpp" | |
62 #include "utilities/copy.hpp" | 63 #include "utilities/copy.hpp" |
63 #include "utilities/defaultStream.hpp" | 64 #include "utilities/defaultStream.hpp" |
64 #include "utilities/dtrace.hpp" | 65 #include "utilities/dtrace.hpp" |
65 #include "utilities/events.hpp" | 66 #include "utilities/events.hpp" |
66 #include "utilities/histogram.hpp" | 67 #include "utilities/histogram.hpp" |
3066 #else /* USDT2 */ | 3067 #else /* USDT2 */ |
3067 HOTSPOT_THREAD_SLEEP_BEGIN( | 3068 HOTSPOT_THREAD_SLEEP_BEGIN( |
3068 millis); | 3069 millis); |
3069 #endif /* USDT2 */ | 3070 #endif /* USDT2 */ |
3070 | 3071 |
3072 EventThreadSleep event; | |
3073 | |
3071 if (millis == 0) { | 3074 if (millis == 0) { |
3072 // When ConvertSleepToYield is on, this matches the classic VM implementation of | 3075 // When ConvertSleepToYield is on, this matches the classic VM implementation of |
3073 // JVM_Sleep. Critical for similar threading behaviour (Win32) | 3076 // JVM_Sleep. Critical for similar threading behaviour (Win32) |
3074 // It appears that in certain GUI contexts, it may be beneficial to do a short sleep | 3077 // It appears that in certain GUI contexts, it may be beneficial to do a short sleep |
3075 // for SOLARIS | 3078 // for SOLARIS |
3086 thread->osthread()->set_state(SLEEPING); | 3089 thread->osthread()->set_state(SLEEPING); |
3087 if (os::sleep(thread, millis, true) == OS_INTRPT) { | 3090 if (os::sleep(thread, millis, true) == OS_INTRPT) { |
3088 // An asynchronous exception (e.g., ThreadDeathException) could have been thrown on | 3091 // An asynchronous exception (e.g., ThreadDeathException) could have been thrown on |
3089 // us while we were sleeping. We do not overwrite those. | 3092 // us while we were sleeping. We do not overwrite those. |
3090 if (!HAS_PENDING_EXCEPTION) { | 3093 if (!HAS_PENDING_EXCEPTION) { |
3094 if (event.should_commit()) { | |
3095 event.set_time(millis); | |
3096 event.commit(); | |
3097 } | |
3091 #ifndef USDT2 | 3098 #ifndef USDT2 |
3092 HS_DTRACE_PROBE1(hotspot, thread__sleep__end,1); | 3099 HS_DTRACE_PROBE1(hotspot, thread__sleep__end,1); |
3093 #else /* USDT2 */ | 3100 #else /* USDT2 */ |
3094 HOTSPOT_THREAD_SLEEP_END( | 3101 HOTSPOT_THREAD_SLEEP_END( |
3095 1); | 3102 1); |
3098 // to properly restore the thread state. That's likely wrong. | 3105 // to properly restore the thread state. That's likely wrong. |
3099 THROW_MSG(vmSymbols::java_lang_InterruptedException(), "sleep interrupted"); | 3106 THROW_MSG(vmSymbols::java_lang_InterruptedException(), "sleep interrupted"); |
3100 } | 3107 } |
3101 } | 3108 } |
3102 thread->osthread()->set_state(old_state); | 3109 thread->osthread()->set_state(old_state); |
3110 } | |
3111 if (event.should_commit()) { | |
3112 event.set_time(millis); | |
3113 event.commit(); | |
3103 } | 3114 } |
3104 #ifndef USDT2 | 3115 #ifndef USDT2 |
3105 HS_DTRACE_PROBE1(hotspot, thread__sleep__end,0); | 3116 HS_DTRACE_PROBE1(hotspot, thread__sleep__end,0); |
3106 #else /* USDT2 */ | 3117 #else /* USDT2 */ |
3107 HOTSPOT_THREAD_SLEEP_END( | 3118 HOTSPOT_THREAD_SLEEP_END( |