equal
deleted
inserted
replaced
1672 void* r = NULL; |
1672 void* r = NULL; |
1673 return thr_getspecific((thread_key_t)index, &r) != 0 ? NULL : r; |
1673 return thr_getspecific((thread_key_t)index, &r) != 0 ? NULL : r; |
1674 } |
1674 } |
1675 |
1675 |
1676 |
1676 |
1677 const int NANOSECS_PER_MILLISECS = 1000000; |
|
1678 // gethrtime can move backwards if read from one cpu and then a different cpu |
1677 // gethrtime can move backwards if read from one cpu and then a different cpu |
1679 // getTimeNanos is guaranteed to not move backward on Solaris |
1678 // getTimeNanos is guaranteed to not move backward on Solaris |
1680 // local spinloop created as faster for a CAS on an int than |
1679 // local spinloop created as faster for a CAS on an int than |
1681 // a CAS on a 64bit jlong. Also Atomic::cmpxchg for jlong is not |
1680 // a CAS on a 64bit jlong. Also Atomic::cmpxchg for jlong is not |
1682 // supported on sparc v8 or pre supports_cx8 intel boxes. |
1681 // supported on sparc v8 or pre supports_cx8 intel boxes. |
1801 |
1800 |
1802 // Used internally for comparisons only |
1801 // Used internally for comparisons only |
1803 // getTimeMillis guaranteed to not move backwards on Solaris |
1802 // getTimeMillis guaranteed to not move backwards on Solaris |
1804 jlong getTimeMillis() { |
1803 jlong getTimeMillis() { |
1805 jlong nanotime = getTimeNanos(); |
1804 jlong nanotime = getTimeNanos(); |
1806 return (jlong)(nanotime / NANOSECS_PER_MILLISECS); |
1805 return (jlong)(nanotime / NANOSECS_PER_MILLISEC); |
1807 } |
1806 } |
1808 |
1807 |
1809 // Must return millis since Jan 1 1970 for JVM_CurrentTimeMillis |
1808 // Must return millis since Jan 1 1970 for JVM_CurrentTimeMillis |
1810 jlong os::javaTimeMillis() { |
1809 jlong os::javaTimeMillis() { |
1811 timeval t; |
1810 timeval t; |
6062 * on the condvar. Contention seen when trying to park implies that someone |
6061 * on the condvar. Contention seen when trying to park implies that someone |
6063 * is unparking you, so don't wait. And spurious returns are fine, so there |
6062 * is unparking you, so don't wait. And spurious returns are fine, so there |
6064 * is no need to track notifications. |
6063 * is no need to track notifications. |
6065 */ |
6064 */ |
6066 |
6065 |
6067 #define NANOSECS_PER_SEC 1000000000 |
|
6068 #define NANOSECS_PER_MILLISEC 1000000 |
|
6069 #define MAX_SECS 100000000 |
6066 #define MAX_SECS 100000000 |
6070 |
|
6071 /* |
6067 /* |
6072 * This code is common to linux and solaris and will be moved to a |
6068 * This code is common to linux and solaris and will be moved to a |
6073 * common place in dolphin. |
6069 * common place in dolphin. |
6074 * |
6070 * |
6075 * The passed in time value is either a relative time in nanoseconds |
6071 * The passed in time value is either a relative time in nanoseconds |