Author: nextgens
Date: 2008-02-15 03:15:31 +0000 (Fri, 15 Feb 2008)
New Revision: 17905

Added:
   trunk/contrib/NativeThread/freenet_support_io_NativeThread.c
Removed:
   trunk/contrib/NativeThread/NativeThread.c
Modified:
   trunk/contrib/NativeThread/Makefile
Log:
freenet-ext: better that way

Modified: trunk/contrib/NativeThread/Makefile
===================================================================
--- trunk/contrib/NativeThread/Makefile 2008-02-15 02:55:13 UTC (rev 17904)
+++ trunk/contrib/NativeThread/Makefile 2008-02-15 03:15:31 UTC (rev 17905)
@@ -5,19 +5,20 @@
 LIBS=-static -lc
 FREEENETDIR=/home/nextgens/repo/freenet/

-all: libNativeThread.so
+all: clean libNativeThread.so

 NativeThread.java:
-       ln -s $(FREEENETDIR)/src/freenet/support/io/NativeThread.java
+       mkdir -p freenet/support/io
+       ln -s $(FREEENETDIR)/src/freenet/support/io/NativeThread.java 
freenet/support/io

 NativeThread.class: NativeThread.java
-       javac NativeThread.java
+       javac freenet/support/io/NativeThread.java

-libNativeThread.so: NativeThread.c NativeThread.h
-       $(CC) $(CFLAGS) -o libNativeThread.so $(LDFLAGS) NativeThread.c $(LIBS)
+libNativeThread.so: freenet_support_io_NativeThread.c NativeThread.h
+       $(CC) $(CFLAGS) -o libNativeThread.so $(LDFLAGS) 
freenet_support_io_NativeThread.c $(LIBS)

 NativeThread.h: NativeThread.class
-       javah NativeThread
+       javah  freenet.support.io.NativeThread

 clean:
-       -rm -f *.class NativeThread.h libNativeThread*.so NativeThread.java
+       -rm -rf freenet *.class *.h libNativeThread*.so NativeThread.java

Deleted: trunk/contrib/NativeThread/NativeThread.c
===================================================================
--- trunk/contrib/NativeThread/NativeThread.c   2008-02-15 02:55:13 UTC (rev 
17904)
+++ trunk/contrib/NativeThread/NativeThread.c   2008-02-15 03:15:31 UTC (rev 
17905)
@@ -1,23 +0,0 @@
-#include<sys/resource.h>
-#include<sys/time.h>
-#include<stdio.h>
-#include <errno.h>
-
-#include"NativeThread.h"
-
-JNIEXPORT jint JNICALL Java_sandbox_NativeThread_getLinuxPriority
-  (JNIEnv * env, jobject jobj) {
-       return getpriority(PRIO_PROCESS, 0);
-}
-
-JNIEXPORT jboolean JNICALL Java_sandbox_NativeThread_setLinuxPriority
-(JNIEnv * env, jobject jobj, jint prio) {
-       int ret;
-       errno = 0;
-       ret = setpriority(PRIO_PROCESS, 0, prio);
-       if (ret == -1 && errno != 0) {
-               printf("Setting the thread priority failed!! %d 
%d\n",ret,errno);
-               return JNI_FALSE;
-       }
-       return JNI_TRUE;
-}

Copied: trunk/contrib/NativeThread/freenet_support_io_NativeThread.c (from rev 
17904, trunk/contrib/NativeThread/NativeThread.c)
===================================================================
--- trunk/contrib/NativeThread/freenet_support_io_NativeThread.c                
                (rev 0)
+++ trunk/contrib/NativeThread/freenet_support_io_NativeThread.c        
2008-02-15 03:15:31 UTC (rev 17905)
@@ -0,0 +1,23 @@
+#include<sys/resource.h>
+#include<sys/time.h>
+#include<stdio.h>
+#include <errno.h>
+
+#include"freenet_support_io_NativeThread.h"
+
+JNIEXPORT jint JNICALL Java_sandbox_NativeThread_getLinuxPriority
+  (JNIEnv * env, jobject jobj) {
+       return getpriority(PRIO_PROCESS, 0);
+}
+
+JNIEXPORT jboolean JNICALL Java_sandbox_NativeThread_setLinuxPriority
+(JNIEnv * env, jobject jobj, jint prio) {
+       int ret;
+       errno = 0;
+       ret = setpriority(PRIO_PROCESS, 0, prio);
+       if (ret == -1 && errno != 0) {
+               printf("Setting the thread priority failed!! %d 
%d\n",ret,errno);
+               return JNI_FALSE;
+       }
+       return JNI_TRUE;
+}


Reply via email to