You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2006/02/10 14:58:20 UTC
svn commit: r376691 - in /webservices/axis2/trunk/c/modules/platforms/unix:
axis2_thread_unix.h thread_unix.c
Author: sahan
Date: Fri Feb 10 05:57:57 2006
New Revision: 376691
URL: http://svn.apache.org/viewcvs?rev=376691&view=rev
Log:
Removed env from function calls
Modified:
webservices/axis2/trunk/c/modules/platforms/unix/axis2_thread_unix.h
webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c
Modified: webservices/axis2/trunk/c/modules/platforms/unix/axis2_thread_unix.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/unix/axis2_thread_unix.h?rev=376691&r1=376690&r2=376691&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/unix/axis2_thread_unix.h (original)
+++ webservices/axis2/trunk/c/modules/platforms/unix/axis2_thread_unix.h Fri Feb 10 05:57:57 2006
@@ -28,7 +28,6 @@
pthread_t *td;
void *data;
axis2_thread_start_t func;
- axis2_status_t exitval;
};
struct axis2_threadattr_t {
Modified: webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c?rev=376691&r1=376690&r2=376691&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c (original)
+++ webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c Fri Feb 10 05:57:57 2006
@@ -14,27 +14,25 @@
* limitations under the License.
*/
-#include "axis2.h"
#include "axis2_thread_unix.h"
AXIS2_DECLARE(axis2_threadattr_t*)
-axis2_threadattr_create(axis2_env_t **env)
+axis2_threadattr_create(axis2_allocator_t* allocator)
{
int stat = 0;
axis2_threadattr_t *new = NULL;
- new = AXIS2_MALLOC((*env)->allocator, sizeof(axis2_threadattr_t));
+ new = AXIS2_MALLOC(allocator, sizeof(axis2_threadattr_t));
if(NULL == new)
{
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE)
return NULL;
}
stat = pthread_attr_init(&(new->attr));
if (stat != 0)
{
- AXIS2_FREE((*env)->allocator, new);
+ AXIS2_FREE(allocator, new);
return NULL;
}
return new;
@@ -59,8 +57,7 @@
#define DETACH_ARG(v) ((v) ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE)
AXIS2_DECLARE(axis2_status_t) axis2_threadattr_detach_set(
- axis2_threadattr_t *attr, axis2_env_t **env,
- axis2_bool_t detached)
+ axis2_threadattr_t *attr, axis2_bool_t detached)
{
if (0 == pthread_attr_setdetachstate(&attr->attr, DETACH_ARG(detached)))
{
@@ -70,7 +67,7 @@
}
AXIS2_DECLARE(axis2_status_t)
-axis2_threadattr_detach_get(axis2_threadattr_t *attr, axis2_env_t **env)
+axis2_threadattr_detach_get(axis2_threadattr_t *attr)
{
int state = 0;
pthread_attr_getdetachstate(&attr->attr, &state);
@@ -88,26 +85,23 @@
}
AXIS2_DECLARE(axis2_thread_t*)
-axis2_thread_create(axis2_env_t **env, axis2_threadattr_t *attr,
+axis2_thread_create(axis2_allocator_t* allocator, axis2_threadattr_t *attr,
axis2_thread_start_t func, void *data)
{
axis2_status_t stat;
pthread_attr_t *temp = NULL;
axis2_thread_t *new = NULL;
- new = (axis2_thread_t *)AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_thread_t));
+ new = (axis2_thread_t *)AXIS2_MALLOC(allocator, sizeof(axis2_thread_t));
if (NULL == new)
{
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
+ return NULL;
}
- new->td = (pthread_t *)AXIS2_MALLOC((*env)->allocator, sizeof(pthread_t));
+ new->td = (pthread_t *)AXIS2_MALLOC(allocator, sizeof(pthread_t));
if (NULL == new->td)
{
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
+ return NULL;
}
new->data = data;
@@ -142,14 +136,14 @@
}
AXIS2_DECLARE(axis2_status_t)
-axis2_thread_exit(axis2_thread_t *thd, axis2_env_t **env)
+axis2_thread_exit(axis2_thread_t *thd)
{
pthread_exit(NULL);
return AXIS2_SUCCESS;
}
AXIS2_DECLARE(axis2_status_t)
-axis2_thread_join(axis2_thread_t *thd, axis2_env_t **env)
+axis2_thread_join(axis2_thread_t *thd)
{
void *thread_stat;
if (0 == pthread_join(*thd->td,(void *)&thread_stat))
@@ -160,7 +154,7 @@
}
AXIS2_DECLARE(axis2_status_t)
-axis2_thread_detach(axis2_thread_t *thd, axis2_env_t **env)
+axis2_thread_detach(axis2_thread_t *thd)
{
if (0 == pthread_detach(*(thd->td)))
{
@@ -169,26 +163,29 @@
return AXIS2_FAILURE;
}
-void axis2_thread_yield(axis2_env_t **env)
+void axis2_thread_yield(void)
{
return;
}
-AXIS2_DECLARE(axis2_os_thread_t)
-axis2_os_thread_get(axis2_thread_t *thd, axis2_env_t **env)
+AXIS2_DECLARE(axis2_os_thread_t*)
+axis2_os_thread_get(axis2_thread_t *thd)
{
- AXIS2_PARAM_CHECK((*env)->error, thd, AXIS2_FAILURE);
- return thd->td;
+ if(NULL == thd)
+ {
+ return NULL;
+ }
+ return thd->td;
}
AXIS2_DECLARE(axis2_status_t)
-axis2_thread_once_init(axis2_thread_once_t **control, axis2_env_t **env)
+axis2_thread_once_init(axis2_thread_once_t **control,
+ axis2_allocator_t* allocator)
{
static const pthread_once_t once_init = PTHREAD_ONCE_INIT;
- *control = AXIS2_MALLOC((*env)->allocator, sizeof(**control));
+ *control = AXIS2_MALLOC(allocator, sizeof(**control));
if(NULL == *control)
{
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
(*control)->once = once_init;
@@ -196,8 +193,7 @@
}
AXIS2_DECLARE(axis2_status_t)
-axis2_thread_once(axis2_thread_once_t *control, axis2_env_t **env,
- void (*func)(void))
+axis2_thread_once(axis2_thread_once_t *control, void (*func)(void))
{
return pthread_once(&control->once, func);
}