Author: mladen.turk(a)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);
Show replies by date