changeset 4984:533177323b2a

. Add a prototype for unpackTime so the definition is visible to the compiler when it's checking the calls to it. . Use HW_USERMEM as was done previously on BSDs without HW_MEMSIZE (which may only be on MacOS X). . semaphore_t isn't defined on BSD, use os_semaphore_t which is a HotSpot type defined to sem_t on BSD. . unpackTime is void, don't assign it's return value to an unused variable.
author Greg Lewis <glewis@eyesbeyond.com>
date Wed, 04 Dec 2013 21:59:22 -0800
parents 34cff91ea65a
children 54995aa29dbb
files src/os/bsd/vm/os_bsd.cpp
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/bsd/vm/os_bsd.cpp	Wed Dec 04 21:56:45 2013 -0800
+++ b/src/os/bsd/vm/os_bsd.cpp	Wed Dec 04 21:59:22 2013 -0800
@@ -187,6 +187,8 @@
 static int SR_signum = SIGUSR2;
 sigset_t SR_sigset;
 
+// Declarations
+static void unpackTime(timespec* absTime, bool isAbsolute, jlong time);
 
 ////////////////////////////////////////////////////////////////////////////////
 // utility functions
@@ -355,7 +357,11 @@
    * since it returns a 64 bit value)
    */
   mib[0] = CTL_HW;
+#ifdef HW_MEMSIZE
   mib[1] = HW_MEMSIZE;
+#else
+  mib[1] = HW_USERMEM;
+#endif
   len = sizeof(mem_val);
   if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1) {
        assert(len == sizeof(mem_val), "unexpected data size");
@@ -2746,7 +2752,7 @@
     bool timedwait(unsigned int sec, int nsec);
   private:
     jlong currenttime() const;
-    semaphore_t _semaphore;
+    os_semaphore_t _semaphore;
 };
 
 Semaphore::Semaphore() : _semaphore(0) {
@@ -2814,7 +2820,7 @@
 
 bool Semaphore::timedwait(unsigned int sec, int nsec) {
   struct timespec ts;
-  jlong endtime = unpackTime(&ts, false, (sec * NANOSECS_PER_SEC) + nsec);
+  unpackTime(&ts, false, (sec * NANOSECS_PER_SEC) + nsec);
 
   while (1) {
     int result = sem_timedwait(&_semaphore, &ts);