You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/09/04 08:56:43 UTC
svn commit: r811231 - in /commons/sandbox/runtime/trunk/src/main/native:
include/acr_error.h include/acr_tlsd.h include/acr_vm.h os/unix/main.c
os/win32/main.c
Author: mturk
Date: Fri Sep 4 06:56:42 2009
New Revision: 811231
URL: http://svn.apache.org/viewvc?rev=811231&view=rev
Log:
Move TLSD to a separate include
Added:
commons/sandbox/runtime/trunk/src/main/native/include/acr_tlsd.h (with props)
Modified:
commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h
commons/sandbox/runtime/trunk/src/main/native/include/acr_vm.h
commons/sandbox/runtime/trunk/src/main/native/os/unix/main.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h?rev=811231&r1=811230&r2=811231&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_error.h Fri Sep 4 06:56:42 2009
@@ -18,6 +18,7 @@
#define _ACR_ERROR_H
#include "acr.h"
+#include "acr_tlsd.h"
#ifdef __cplusplus
extern "C" {
Added: commons/sandbox/runtime/trunk/src/main/native/include/acr_tlsd.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_tlsd.h?rev=811231&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_tlsd.h (added)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_tlsd.h Fri Sep 4 06:56:42 2009
@@ -0,0 +1,70 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACR_TLSD_H
+#define _ACR_TLSD_H
+
+#include "acr.h"
+#include "acr_ring.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file acr_tlsd.h
+ * @brief
+ *
+ * ACR Thread Local data functions
+ *
+ */
+typedef struct acr_thread_local_t acr_thread_local_t;
+typedef struct acr_tlsd_data_t acr_tlsd_data_t;
+
+struct acr_tlsd_data_t {
+ ACR_RING_ENTRY(acr_tlsd_data_t) link;
+ void *data;
+ size_t size;
+};
+
+struct acr_thread_local_t {
+ ACR_RING_HEAD(tlsd_data_t, acr_tlsd_data_t) data_ring;
+ JNIEnv *env;
+ int jvm_attached;
+};
+
+/**
+ * Get current thread local storage data
+ * @note NULL is never returned. In case of memory error
+ * returned is the static data that will be overwritten by the
+ * next thread.
+ */
+ACR_DECLARE(acr_thread_local_t *) ACR_GetTLSD(void);
+
+/**
+ * Add the data to the current thread local storage data.
+ * @param data Data to add. Free() will be called on that
+ * data if len is larger then zero.
+ * @param len Data length. Use zero for const data.
+ * @return Zero on success and error code in case of error.
+ */
+ACR_DECLARE(int) ACR_TLDSAddData(void *data, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ACR_TLSD_H */
Propchange: commons/sandbox/runtime/trunk/src/main/native/include/acr_tlsd.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_vm.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_vm.h?rev=811231&r1=811230&r2=811231&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_vm.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_vm.h Fri Sep 4 06:56:42 2009
@@ -18,7 +18,6 @@
#define _ACR_VM_H
#include "acr.h"
-#include "acr_ring.h"
#ifdef __cplusplus
extern "C" {
@@ -31,37 +30,6 @@
* ACR JVM functions
*
*/
-typedef struct acr_thread_local_t acr_thread_local_t;
-typedef struct acr_tlsd_data_t acr_tlsd_data_t;
-
-struct acr_tlsd_data_t {
- ACR_RING_ENTRY(acr_tlsd_data_t) link;
- void *data;
- size_t size;
-};
-
-struct acr_thread_local_t {
- ACR_RING_HEAD(tlsd_data_t, acr_tlsd_data_t) data_ring;
- JNIEnv *env;
- int jvm_attached;
-};
-
-/**
- * Get current thread local storage data
- * @note NULL is never returned. In case of memory error
- * returned is the static data that will be overwritten by the
- * next thread.
- */
-ACR_DECLARE(acr_thread_local_t *) ACR_GetTLSD(void);
-
-/**
- * Add the data to the current thread local storage data.
- * @param data Data to add. Free() will be called on that
- * data if len is larger then zero.
- * @param len Data length. Use zero for const data.
- * @return Zero on success and error code in case of error.
- */
-ACR_DECLARE(int) ACR_TLDSAddData(void *data, size_t len);
/**
* Get current thread JNI Environment
@@ -89,4 +57,3 @@
#endif
#endif /* _ACR_VM_H */
-
Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/main.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/main.c?rev=811231&r1=811230&r2=811231&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/main.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/main.c Fri Sep 4 06:56:42 2009
@@ -18,6 +18,7 @@
#include "acr_private.h"
#include "acr_arch.h"
#include "acr_error.h"
+#include "acr_tlsd.h"
#include "acr_vm.h"
#if defined(SOLARIS22) && defined(HAS_NATIVE_THREADS)
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c?rev=811231&r1=811230&r2=811231&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c Fri Sep 4 06:56:42 2009
@@ -17,6 +17,7 @@
#include "acr.h"
#include "acr_private.h"
#include "acr_error.h"
+#include "acr_tlsd.h"
#include "acr_vm.h"
#define ACR_WANT_LATE_DLL