[jbossnative-commits] JBoss Native SVN: r1054 - in trunk/sight/native: os/windows and 1 other directory.

jbossnative-commits at lists.jboss.org jbossnative-commits at lists.jboss.org
Fri Sep 28 04:26:04 EDT 2007


Author: mladen.turk at jboss.com
Date: 2007-09-28 04:26:03 -0400 (Fri, 28 Sep 2007)
New Revision: 1054

Modified:
   trunk/sight/native/include/sight_types.h
   trunk/sight/native/os/windows/process.c
Log:
Fix JBNATIVE-38 by adding reference counter for long running native ops.

Modified: trunk/sight/native/include/sight_types.h
===================================================================
--- trunk/sight/native/include/sight_types.h	2007-09-28 08:25:49 UTC (rev 1053)
+++ trunk/sight/native/include/sight_types.h	2007-09-28 08:26:03 UTC (rev 1054)
@@ -110,6 +110,7 @@
 
 /* org.jboss.sight.NativeObject instance */
 struct sight_object_t {
+    volatile apr_uint32_t references;
     apr_pool_t      *pool;
     void            *native;
     void            *opaque;
@@ -119,6 +120,9 @@
     void             (*clean)(int, sight_object_t *);
 };
 
+#define SIGHT_NO_IREF(N) apr_atomic_inc32(&((N)->references))
+#define SIGHT_NO_DREF(N) apr_atomic_dec32(&((N)->references))
+
 #define        CACHE_HASH_MASK        255
 #define        CACHE_HASH_SIZE        256
 

Modified: trunk/sight/native/os/windows/process.c
===================================================================
--- trunk/sight/native/os/windows/process.c	2007-09-28 08:25:49 UTC (rev 1053)
+++ trunk/sight/native/os/windows/process.c	2007-09-28 08:26:03 UTC (rev 1054)
@@ -482,6 +482,7 @@
         LPWSTR  cmdl;
         int     pargc;
         LPWSTR *pargs;
+        printf("Process SELF!!!\n");
         if ((env = GetEnvironmentStringsW())) {
             SET_IFIELD_O(0004, thiz, sight_mw_to_sa(_E, env));
             FreeEnvironmentStrings(env);




More information about the jbossnative-commits mailing list