harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r498792 - /harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrdsup.h
Date Mon, 22 Jan 2007 20:48:31 GMT
Author: hindessm
Date: Mon Jan 22 12:48:29 2007
New Revision: 498792

URL: http://svn.apache.org/viewvc?view=rev&rev=498792
Log:
Semaphore defines are also valid on FreeBSD.

Modified:
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrdsup.h

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrdsup.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrdsup.h?view=diff&rev=498792&r1=498791&r2=498792
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrdsup.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrdsup.h
Mon Jan 22 12:48:29 2007
@@ -38,7 +38,7 @@
 #define WRAPPER_TYPE void*
 typedef void *WRAPPER_ARG;
 #define WRAPPER_RETURN() return NULL
-#if defined(LINUX)
+#if defined(LINUX) || defined(FREEBSD)
 #include <semaphore.h>
 typedef sem_t OSSEMAPHORE;
 #else
@@ -73,7 +73,7 @@
 #define HYDIV div
 /* do we really need nanosecond clock accuracy even on platforms which support gettime? */
 
-#define TIMEOUT_CLOCK
+#define TIMEOUT_CLOCK CLOCK_REALTIME
 
 #if (defined(LINUX))
 #define SETUP_TIMEOUT(ts_, millis, nanos) {								\
@@ -142,7 +142,7 @@
 #define THREAD_SELF() (pthread_self())
 
 /* THREAD_YIELD */
-#if defined(LINUX)
+#if defined(LINUX) || defined(FREEBSD)
 #define THREAD_YIELD() (sched_yield())
 #endif
 
@@ -202,54 +202,54 @@
 #define THREAD_SET_PRIORITY(thread, priority) set_pthread_priority((thread), (priority))
 
 /* SEM_CREATE */
-#if defined(LINUX)
+#if defined(LINUX) || defined(FREEBSD)
 #define SEM_CREATE(initValue) thread_malloc(NULL, sizeof(OSSEMAPHORE))
 #else
 #define SEM_CREATE(initValue)
 #endif
 
 /* SEM_INIT */
-#if defined(LINUX)
+#if defined(LINUX) || defined(FREEBSD)
 #define SEM_INIT(sm, pshrd, inval)	(sem_init((sem_t*)sm, pshrd, inval))
 #else
 #define SEM_INIT(sm,pshrd,inval)
 #endif
 
 /* SEM_DESTROY */
-#if defined(LINUX)
+#if defined(LINUX) || defined(FREEBSD)
 #define SEM_DESTROY(sm)	(sem_destroy((sem_t*)sm))
 #else
 #define SEM_DESTROY(sm)
 #endif
 
 /* SEM_FREE */
-#if defined(LINUX)
+#if defined(LINUX) || defined(FREEBSD)
 #define	SEM_FREE(s)  	thread_free(NULL, (sem_t*)s);
 #endif
 
 /* SEM_POST */
-#if defined(LINUX)
+#if defined(LINUX) || defined(FREEBSD)
 #define SEM_POST(smP)	(sem_post((sem_t*)smP))
 #else
 #define SEM_POST(sm)
 #endif
 
 /* SEM_WAIT */
-#if defined(LINUX)
+#if defined(LINUX) || defined(FREEBSD)
 #define SEM_WAIT(smP)	(sem_wait((sem_t*)smP))
 #else
 #define SEM_WAIT(sm)
 #endif
 
 /* SEM_TRYWAIT */
-#if defined(LINUX)
+#if defined(LINUX) || defined(FREEBSD)
 #define SEM_TRYWAIT(smP)	(sem_trywait(smP))
 #else
 #define SEM_TRYWAIT(sm)
 #endif
 
 /* SEM_GETVALUE */
-#if defined(LINUX)
+#if defined(LINUX) || defined(FREEBSD)
 #define SEM_GETVALUE(smP, intP)	(sem_getvalue(smP, intP))
 #else
 #define SEM_GETVALUE(sm)



Mime
View raw message