[kaffe] ksem interface & MAIN_MD
Alexander Boettcher
ab764283 at os.inf.tu-dresden.de
Wed Sep 29 02:02:09 PDT 2004
Hi,
somehow the test for THREAD_SYSTEM_HAS_KSEM in ksem.c was lost during
the last months. It's neccessary if an port provides its own ksem
semaphore implementation. At the moment you get double defined
functions. Additional, is it possible to move the declaration of the
ksem* functions into the ifdef of THREAD_SYSTEM_HAS_KSEM in ksem.h ? So,
it is possible to declare also inline ksem functions, if the ksem
implementation of the functions is small. Please, look at the diff, it
does not affect unix-pthreads or unix-jthreads, but is necessary for
ports with its own ksem implementation.
Another question,
in the Changelog entry 2004-06-15 is described that the call to
INIT_MD was removed from the kaffe/kaffe/main.c file. But in fact, the
call to MAIN_MD was removed. Can we reintroduce it ? Because it's
necessary for the oskit (it uses INIT_MD and MAIN_MD in different
manner) and for our port. MAIN_MD was/is useful if you have to initialize
some things before Kaffe becomes running.
Thx,
regards,
Alexander Böttcher.
-------------- next part --------------
Index: ksem.c
===================================================================
RCS file: /cvs/kaffe/kaffe/kaffe/kaffevm/ksem.c,v
retrieving revision 1.7
diff -u -r1.7 ksem.c
--- ksem.c 2 Aug 2004 10:44:56 -0000 1.7
+++ ksem.c 29 Sep 2004 08:35:25 -0000
@@ -10,6 +10,8 @@
#include "ksem.h"
+#ifndef THREAD_SYSTEM_HAS_KSEM
+
/*
* Initialize the just-allocated Ksem. This function is only invoked
* by the threading system when a new thread is allocated.
@@ -86,3 +88,5 @@
jmutex_destroy(&(sem->mux));
jcondvar_destroy(&(sem->cv));
}
+
+#endif
Index: ksem.h
===================================================================
RCS file: /cvs/kaffe/kaffe/kaffe/kaffevm/ksem.h,v
retrieving revision 1.8
diff -u -r1.8 ksem.h
--- ksem.h 20 Apr 2004 16:53:25 -0000 1.8
+++ ksem.h 29 Sep 2004 08:35:25 -0000
@@ -20,11 +20,6 @@
*/
struct Ksem;
-extern void ksemInit(struct Ksem* sem);
-extern void ksemPut(struct Ksem* sem);
-extern jboolean ksemGet(struct Ksem* sem, jlong timeout);
-extern void ksemDestroy(struct Ksem* sem);
-
/*
* Include the system locking layer interface. See if it gives us
* Ksem's or jmutex/jcondvar's (see FAQ.locks).
@@ -44,6 +39,11 @@
*/
#ifndef THREAD_SYSTEM_HAS_KSEM
+ extern void ksemInit(struct Ksem* sem);
+ extern void ksemPut(struct Ksem* sem);
+ extern jboolean ksemGet(struct Ksem* sem, jlong timeout);
+ extern void ksemDestroy(struct Ksem* sem);
+
/*
* Present POSIX mutex+condvar as a binary semaphore.
*/
@@ -52,6 +52,5 @@
jcondvar cv;
int count;
} Ksem;
-
#endif /* !defined(JTHREAD_HAS_KSEM) */
#endif /* kaffevm_ksem_h */
More information about the kaffe
mailing list