Author: mturk
Date: Tue Apr 19 05:45:01 2011
New Revision: 1094858

URL: http://svn.apache.org/viewvc?rev=1094858&view=rev
Log:
Axe thread local ring

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h
    commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c
    commons/sandbox/runtime/trunk/src/main/native/os/win32/init.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h
URL: 
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h?rev=1094858&r1=1094857&r2=1094858&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h 
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h Tue Apr 
19 05:45:01 2011
@@ -18,21 +18,6 @@
 #define _ACR_JNIAPI_H_
 
 #include "acr/jnitypes.h"
-#include "acr/ring.h"
-
-/**
- * The prototype for any ACR thread local storage destructor function.
- */
-typedef void (*acr_tls_destructor_t)(const void *, void *);
-typedef struct acr_tlsd_t  {
-    ACR_RING_ENTRY(acr_tlsd_t)  link;
-    const void                  *key;
-    void                        *val;
-    /** Destroy callback.
-     * If NULL pr_mfree(val) will be called
-     */
-    acr_tls_destructor_t        dtor;
-} acr_tlsd_t;
 
 #define ACR_SAVE_ERROR(err)     AcrSetThreadError((err))
 #define ACR_SAVE_OS_ERROR()     AcrSetThreadError(ACR_GET_OS_ERROR())

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c
URL: 
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c?rev=1094858&r1=1094857&r2=1094858&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c Tue Apr 19 
05:45:01 2011
@@ -28,8 +28,6 @@ static pthread_mutex_t   _lib_mutex  = P
 
 typedef struct tlsd_t
 {
-    /** Private thread strorage list */
-    ACR_RING_HEAD(_cr_tlsd_s, acr_tlsd_t) tlsd;
     JNIEnv      *env;
     int          attached;
     int          error;
@@ -38,18 +36,8 @@ typedef struct tlsd_t
 
 static void _threadkey_destructor(void *data)
 {
-    acr_tlsd_t *p;
-    acr_tlsd_t *c;
     tlsd_t *env = (tlsd_t *)data;
 
-    ACR_RING_FOREACH_SAFE(c, p, &env->tlsd, acr_tlsd_t, link) {
-        ACR_RING_REMOVE(c, link);
-        if (c->dtor)
-            c->dtor(c->key, c->val);
-        else
-            AcrFree(c->val);
-        AcrFree(c);
-    }
     if (env->attached && _java_vm != 0) {
         /* Detach current thread */
         (*_java_vm)->DetachCurrentThread(_java_vm);
@@ -69,7 +57,6 @@ static tlsd_t *_threadkey_get(void)
             return 0;
         }
         else {
-            ACR_RING_INIT(&env->tlsd, acr_tlsd_t, link);
             env->id = (((acr_u64_t)P2J(pthread_self())) >> 3);
             pthread_setspecific(_threadkey, env);
         }

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/init.c
URL: 
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/init.c?rev=1094858&r1=1094857&r2=1094858&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/init.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/init.c Tue Apr 19 
05:45:01 2011
@@ -35,8 +35,6 @@ HANDLE                  acr_raised_event
 
 typedef struct tlsd_t
 {
-    /** Private thread strorage list */
-    ACR_RING_HEAD(_cr_tlsd_s, acr_tlsd_t) tlsd;
     JNIEnv      *env;
     int          attached;
     int          error;
@@ -45,18 +43,8 @@ typedef struct tlsd_t
 
 static void _threadkey_destructor(void *data)
 {
-    acr_tlsd_t *p;
-    acr_tlsd_t *c;
     tlsd_t *env = (tlsd_t *)data;
 
-    ACR_RING_FOREACH_SAFE(c, p, &env->tlsd, acr_tlsd_t, link) {
-        ACR_RING_REMOVE(c, link);
-        if (c->dtor)
-            c->dtor(c->key, c->val);
-        else
-            AcrFree(c->val);
-        AcrFree(c);
-    }
     if (env->attached && _java_vm != 0) {
         /* Detach current thread */
         (*_java_vm)->DetachCurrentThread(_java_vm);
@@ -76,7 +64,6 @@ static tlsd_t *_threadkey_get(void)
             return 0;
         }
         else {
-            ACR_RING_INIT(&env->tlsd, acr_tlsd_t, link);
             env->id = GetCurrentThreadId();
             TlsSetValue(_threadkey, env);
         }


Reply via email to