8008559: [parfait] Path through non-void function '_ZN2os15thread_cpu_timeEP6Thread' returns an undefined value
Summary: safety checks for non-Apple thread time functions
Reviewed-by: kvn
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp Fri Mar 01 14:26:34 2013 -0800
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp Mon Mar 04 13:15:01 2013 -0800
@@ -3903,15 +3903,27 @@
jlong os::current_thread_cpu_time() {
#ifdef __APPLE__
return os::thread_cpu_time(Thread::current(), true /* user + sys */);
+#else
+ Unimplemented();
+ return 0;
#endif
}
jlong os::thread_cpu_time(Thread* thread) {
+#ifdef __APPLE__
+ return os::thread_cpu_time(thread, true /* user + sys */);
+#else
+ Unimplemented();
+ return 0;
+#endif
}
jlong os::current_thread_cpu_time(bool user_sys_cpu_time) {
#ifdef __APPLE__
return os::thread_cpu_time(Thread::current(), user_sys_cpu_time);
+#else
+ Unimplemented();
+ return 0;
#endif
}
@@ -3935,6 +3947,9 @@
} else {
return ((jlong)tinfo.user_time.seconds * 1000000000) + ((jlong)tinfo.user_time.microseconds * (jlong)1000);
}
+#else
+ Unimplemented();
+ return 0;
#endif
}