costin      02/04/17 15:51:02

  Modified:    jk/native2/jni jk_jni_aprImpl.c
  Log:
  Small fix in shmAttach.
  
  Started to add mutexes ( to support shm end not only ).
  
  Again ( see the comments in AprImpl ) - the interfaces are not even started,
  this is just the JNI code. AprImpl will have many native methods, with longs and
  other strange things - not to be called by any user code.
  
  Also note that we'll not support all APR functions - only what's missing
  in java.
  
  Revision  Changes    Path
  1.11      +23 -1     jakarta-tomcat-connectors/jk/native2/jni/jk_jni_aprImpl.c
  
  Index: jk_jni_aprImpl.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/jni/jk_jni_aprImpl.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- jk_jni_aprImpl.c  15 Apr 2002 23:54:51 -0000      1.10
  +++ jk_jni_aprImpl.c  17 Apr 2002 22:51:02 -0000      1.11
  @@ -94,6 +94,9 @@
   #include "apr_shm.h"
   #endif
   
  +#include "apr_proc_mutex.h"
  +
  +
   JNIEXPORT jint JNICALL 
   Java_org_apache_jk_apr_AprImpl_initialize(JNIEnv *jniEnv, jobject _jthis)
   {
  @@ -189,7 +192,7 @@
   
   JNIEXPORT jlong JNICALL 
   Java_org_apache_jk_apr_AprImpl_shmAttach(JNIEnv *jniEnv, jobject _jthis, jlong 
poolJ,
  -                                       jlong size, jstring fileJ)
  +                                         jstring fileJ)
   {
       char *fname=(char *)(*jniEnv)->GetStringUTFChars(jniEnv, fileJ, 0);
       apr_pool_t *pool=(apr_pool_t *)(void *)(long)poolJ;
  @@ -289,6 +292,25 @@
   }
   
   #endif 
  +
  +/* -------------------- interprocess mutexes -------------------- */
  +
  +JNIEXPORT jlong JNICALL 
  +Java_org_apache_jk_apr_AprImpl_mutexCreate(JNIEnv *jniEnv, jobject _jthis, jlong 
pool,
  +                                           jstring fileJ,
  +                                           jint mechJ )
  +{
  +    apr_proc_mutex_t *mutex;
  +    char *fname;
  +    apr_lockmech_e mech;
  +    apr_pool_t *pool;
  +    apr_status_t  st;
  +    
  +    st=apr_proc_mutex_create( &mutex, fname, mech, pool );
  +    
  +    return (jlong)(long)(void *)mutex;
  +}
  +
   
   /* ==================== Unix sockets ==================== */
   /* It seems apr doesn't support them yet, so this code will use the
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to