commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1092675 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/ java/org/apache/commons/runtime/platform/windows/ native/os/unix/
Date Fri, 15 Apr 2011 12:03:28 GMT
Author: mturk
Date: Fri Apr 15 12:03:28 2011
New Revision: 1092675

URL: http://svn.apache.org/viewvc?rev=1092675&view=rev
Log:
Allow platforms without posix semaphores.

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/LocalStrings.properties
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Semaphore.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsMutex.java
    commons/sandbox/runtime/trunk/src/main/native/os/unix/semaphore.c

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/LocalStrings.properties
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/LocalStrings.properties?rev=1092675&r1=1092674&r2=1092675&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/LocalStrings.properties
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/LocalStrings.properties
Fri Apr 15 12:03:28 2011
@@ -16,3 +16,4 @@
 os.ENOTIMPL=Apache Commons Runtime does not support this operating system
 os.EVERSION=Apache Commons Runtime does not support this operating system version
 mutextype.EINVAL=Invalid MutexType enum initializer ({0})
+semaphore.ENOTIMPL=Apache Commons Runtime does not support semaphores on this platform

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Semaphore.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Semaphore.java?rev=1092675&r1=1092674&r2=1092675&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Semaphore.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Semaphore.java
Fri Apr 15 12:03:28 2011
@@ -16,6 +16,7 @@
 package org.apache.commons.runtime;
 
 import org.apache.commons.runtime.exception.SystemException;
+import org.apache.commons.runtime.exception.NotImplementedException;
 
 /**
  * Semaphore class.
@@ -44,7 +45,10 @@ public abstract class Semaphore
     protected boolean owner;
 
     public static final SemaphoreImpl getImpl()
+        throws NotImplementedException
     {
+        if (impl == null)
+            throw new NotImplementedException(Local.sm.get("semaphore.ENOTIMPL"));
         return impl;
     }
 

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsMutex.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsMutex.java?rev=1092675&r1=1092674&r2=1092675&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsMutex.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsMutex.java
Fri Apr 15 12:03:28 2011
@@ -19,7 +19,6 @@ import org.apache.commons.runtime.Mutex;
 import org.apache.commons.runtime.Status;
 import org.apache.commons.runtime.exception.AlreadyExistsException;
 import org.apache.commons.runtime.exception.NoSuchObjectException;
-import org.apache.commons.runtime.exception.NotImplementedException;
 import org.apache.commons.runtime.exception.ClosedDescriptorException;
 import org.apache.commons.runtime.exception.SystemException;
 
@@ -42,7 +41,6 @@ final class WindowsMutex extends Mutex
         throws IllegalAccessException,
                IllegalArgumentException,
                AlreadyExistsException,
-               NotImplementedException,
                SystemException
     {
         this.owner = true;

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/semaphore.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/semaphore.c?rev=1092675&r1=1092674&r2=1092675&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/semaphore.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/semaphore.c Fri Apr 15 12:03:28
2011
@@ -19,6 +19,7 @@
 #include "acr/port.h"
 #include "arch_defs.h"
 
+#if HAVE_POSIX_SEMAPHORE
 #if HAVE_SEMAPHORE_H
 # include <semaphore.h>
 
@@ -194,3 +195,9 @@ ACR_UNX_EXPORT(jint, PosixSemaphore, rel
     else
         return 0;
 }
+#else
+ACR_JNI_EXPORT(jobject, Semaphore, impl0)(JNI_STDARGS)
+{
+    return 0;    
+}
+#endif



Mime
View raw message