[core] rename lib apr symbols to fspr

This commit is contained in:
Chris Rienzo authored and Andrey Volk committed 2022-08-29 20:17:08 +03:00
1 parent 3c7e8ff989
commit 5c2726f413
354 files changed
+11614 -11614

No files matched your search

+83 -83
View File
@@ -14,16 +14,16 @@
* limitations under the License.
*/
#include "apr_arch_threadproc.h"
#include "apr_arch_file_io.h"
#include "apr_strings.h"
#include "apr_portable.h"
#include "fspr_arch_threadproc.h"
#include "fspr_arch_file_io.h"
#include "fspr_strings.h"
#include "fspr_portable.h"
#include <proc.h>
apr_status_t apr_netware_proc_cleanup(void *theproc)
fspr_status_t fspr_netware_proc_cleanup(void *theproc)
{
apr_proc_t *proc = theproc;
fspr_proc_t *proc = theproc;
int exit_int;
int waitpid_options = WUNTRACED | WNOHANG;
@@ -35,9 +35,9 @@ apr_status_t apr_netware_proc_cleanup(void *theproc)
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *pool)
APR_DECLARE(fspr_status_t) fspr_procattr_create(fspr_procattr_t **new,fspr_pool_t *pool)
{
(*new) = (apr_procattr_t *)apr_pcalloc(pool, sizeof(apr_procattr_t));
(*new) = (fspr_procattr_t *)fspr_pcalloc(pool, sizeof(fspr_procattr_t));
if ((*new) == NULL) {
return APR_ENOMEM;
@@ -45,18 +45,18 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *p
(*new)->pool = pool;
(*new)->cmdtype = APR_PROGRAM;
/* Default to a current path since NetWare doesn't handle it very well */
apr_filepath_get(&((*new)->currdir), APR_FILEPATH_NATIVE, pool);
fspr_filepath_get(&((*new)->currdir), APR_FILEPATH_NATIVE, pool);
(*new)->detached = 1;
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in,
apr_int32_t out, apr_int32_t err)
APR_DECLARE(fspr_status_t) fspr_procattr_io_set(fspr_procattr_t *attr, fspr_int32_t in,
fspr_int32_t out, fspr_int32_t err)
{
apr_status_t status;
fspr_status_t status;
if (in != 0) {
if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
if ((status = fspr_file_pipe_create(&attr->child_in, &attr->parent_in,
attr->pool)) != APR_SUCCESS) {
return status;
}
@@ -64,18 +64,18 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t
case APR_FULL_BLOCK:
break;
case APR_PARENT_BLOCK:
apr_file_pipe_timeout_set(attr->child_in, 0);
fspr_file_pipe_timeout_set(attr->child_in, 0);
break;
case APR_CHILD_BLOCK:
apr_file_pipe_timeout_set(attr->parent_in, 0);
fspr_file_pipe_timeout_set(attr->parent_in, 0);
break;
default:
apr_file_pipe_timeout_set(attr->child_in, 0);
apr_file_pipe_timeout_set(attr->parent_in, 0);
fspr_file_pipe_timeout_set(attr->child_in, 0);
fspr_file_pipe_timeout_set(attr->parent_in, 0);
}
}
if (out) {
if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
if ((status = fspr_file_pipe_create(&attr->parent_out, &attr->child_out,
attr->pool)) != APR_SUCCESS) {
return status;
}
@@ -83,18 +83,18 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t
case APR_FULL_BLOCK:
break;
case APR_PARENT_BLOCK:
apr_file_pipe_timeout_set(attr->child_out, 0);
fspr_file_pipe_timeout_set(attr->child_out, 0);
break;
case APR_CHILD_BLOCK:
apr_file_pipe_timeout_set(attr->parent_out, 0);
fspr_file_pipe_timeout_set(attr->parent_out, 0);
break;
default:
apr_file_pipe_timeout_set(attr->child_out, 0);
apr_file_pipe_timeout_set(attr->parent_out, 0);
fspr_file_pipe_timeout_set(attr->child_out, 0);
fspr_file_pipe_timeout_set(attr->parent_out, 0);
}
}
if (err) {
if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
if ((status = fspr_file_pipe_create(&attr->parent_err, &attr->child_err,
attr->pool)) != APR_SUCCESS) {
return status;
}
@@ -102,90 +102,90 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t
case APR_FULL_BLOCK:
break;
case APR_PARENT_BLOCK:
apr_file_pipe_timeout_set(attr->child_err, 0);
fspr_file_pipe_timeout_set(attr->child_err, 0);
break;
case APR_CHILD_BLOCK:
apr_file_pipe_timeout_set(attr->parent_err, 0);
fspr_file_pipe_timeout_set(attr->parent_err, 0);
break;
default:
apr_file_pipe_timeout_set(attr->child_err, 0);
apr_file_pipe_timeout_set(attr->parent_err, 0);
fspr_file_pipe_timeout_set(attr->child_err, 0);
fspr_file_pipe_timeout_set(attr->parent_err, 0);
}
}
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in,
apr_file_t *parent_in)
APR_DECLARE(fspr_status_t) fspr_procattr_child_in_set(fspr_procattr_t *attr, fspr_file_t *child_in,
fspr_file_t *parent_in)
{
if (attr->child_in == NULL && attr->parent_in == NULL)
apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
if (child_in != NULL)
apr_file_dup2(attr->child_in, child_in, attr->pool);
fspr_file_dup2(attr->child_in, child_in, attr->pool);
if (parent_in != NULL)
apr_file_dup2(attr->parent_in, parent_in, attr->pool);
fspr_file_dup2(attr->parent_in, parent_in, attr->pool);
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out,
apr_file_t *parent_out)
APR_DECLARE(fspr_status_t) fspr_procattr_child_out_set(fspr_procattr_t *attr, fspr_file_t *child_out,
fspr_file_t *parent_out)
{
if (attr->child_out == NULL && attr->parent_out == NULL)
apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
fspr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
if (child_out != NULL)
apr_file_dup2(attr->child_out, child_out, attr->pool);
fspr_file_dup2(attr->child_out, child_out, attr->pool);
if (parent_out != NULL)
apr_file_dup2(attr->parent_out, parent_out, attr->pool);
fspr_file_dup2(attr->parent_out, parent_out, attr->pool);
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err,
apr_file_t *parent_err)
APR_DECLARE(fspr_status_t) fspr_procattr_child_err_set(fspr_procattr_t *attr, fspr_file_t *child_err,
fspr_file_t *parent_err)
{
if (attr->child_err == NULL && attr->parent_err == NULL)
apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
fspr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
if (child_err != NULL)
apr_file_dup2(attr->child_err, child_err, attr->pool);
fspr_file_dup2(attr->child_err, child_err, attr->pool);
if (parent_err != NULL)
apr_file_dup2(attr->parent_err, parent_err, attr->pool);
fspr_file_dup2(attr->parent_err, parent_err, attr->pool);
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
APR_DECLARE(fspr_status_t) fspr_procattr_dir_set(fspr_procattr_t *attr,
const char *dir)
{
return apr_filepath_merge(&attr->currdir, NULL, dir,
return fspr_filepath_merge(&attr->currdir, NULL, dir,
APR_FILEPATH_NATIVE, attr->pool);
}
APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr,
apr_cmdtype_e cmd)
APR_DECLARE(fspr_status_t) fspr_procattr_cmdtype_set(fspr_procattr_t *attr,
fspr_cmdtype_e cmd)
{
/* won't ever be called on this platform, so don't save the function pointer */
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach)
APR_DECLARE(fspr_status_t) fspr_procattr_detach_set(fspr_procattr_t *attr, fspr_int32_t detach)
{
attr->detached = detach;
return APR_SUCCESS;
}
#if APR_HAS_FORK
APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool)
APR_DECLARE(fspr_status_t) fspr_proc_fork(fspr_proc_t *proc, fspr_pool_t *pool)
{
int pid;
@@ -207,7 +207,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool)
}
#endif
static apr_status_t limit_proc(apr_procattr_t *attr)
static fspr_status_t limit_proc(fspr_procattr_t *attr)
{
#if APR_HAVE_STRUCT_RLIMIT && APR_HAVE_SETRLIMIT
#ifdef RLIMIT_CPU
@@ -252,33 +252,33 @@ static apr_status_t limit_proc(apr_procattr_t *attr)
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr,
apr_child_errfn_t *errfn)
APR_DECLARE(fspr_status_t) fspr_procattr_child_errfn_set(fspr_procattr_t *attr,
fspr_child_errfn_t *errfn)
{
/* won't ever be called on this platform, so don't save the function pointer */
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
apr_int32_t chk)
APR_DECLARE(fspr_status_t) fspr_procattr_error_check_set(fspr_procattr_t *attr,
fspr_int32_t chk)
{
/* won't ever be used on this platform, so don't save the flag */
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
apr_int32_t addrspace)
APR_DECLARE(fspr_status_t) fspr_procattr_addrspace_set(fspr_procattr_t *attr,
fspr_int32_t addrspace)
{
attr->addrspace = addrspace;
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
APR_DECLARE(fspr_status_t) fspr_proc_create(fspr_proc_t *newproc,
const char *progname,
const char * const *args,
const char * const *env,
apr_procattr_t *attr,
apr_pool_t *pool)
fspr_procattr_t *attr,
fspr_pool_t *pool)
{
wiring_t wire;
int addr_space;
@@ -299,9 +299,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
if (attr->currdir) {
char *fullpath = NULL;
apr_status_t rv;
fspr_status_t rv;
if ((rv = apr_filepath_merge(&fullpath, attr->currdir, progname,
if ((rv = fspr_filepath_merge(&fullpath, attr->currdir, progname,
APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) {
return rv;
}
@@ -314,47 +314,47 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
}
if (attr->child_in) {
apr_pool_cleanup_kill(apr_file_pool_get(attr->child_in),
attr->child_in, apr_unix_file_cleanup);
apr_file_close(attr->child_in);
fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_in),
attr->child_in, fspr_unix_file_cleanup);
fspr_file_close(attr->child_in);
}
if (attr->child_out) {
apr_pool_cleanup_kill(apr_file_pool_get(attr->child_out),
attr->child_out, apr_unix_file_cleanup);
apr_file_close(attr->child_out);
fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_out),
attr->child_out, fspr_unix_file_cleanup);
fspr_file_close(attr->child_out);
}
if (attr->child_err) {
apr_pool_cleanup_kill(apr_file_pool_get(attr->child_err),
attr->child_err, apr_unix_file_cleanup);
apr_file_close(attr->child_err);
fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_err),
attr->child_err, fspr_unix_file_cleanup);
fspr_file_close(attr->child_err);
}
apr_pool_cleanup_register(pool, (void *)newproc, apr_netware_proc_cleanup,
apr_pool_cleanup_null);
fspr_pool_cleanup_register(pool, (void *)newproc, fspr_netware_proc_cleanup,
fspr_pool_cleanup_null);
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
APR_DECLARE(fspr_status_t) fspr_proc_wait_all_procs(fspr_proc_t *proc,
int *exitcode,
apr_exit_why_e *exitwhy,
apr_wait_how_e waithow,
apr_pool_t *p)
fspr_exit_why_e *exitwhy,
fspr_wait_how_e waithow,
fspr_pool_t *p)
{
proc->pid = -1;
return apr_proc_wait(proc, exitcode, exitwhy, waithow);
return fspr_proc_wait(proc, exitcode, exitwhy, waithow);
}
APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
int *exitcode, apr_exit_why_e *exitwhy,
apr_wait_how_e waithow)
APR_DECLARE(fspr_status_t) fspr_proc_wait(fspr_proc_t *proc,
int *exitcode, fspr_exit_why_e *exitwhy,
fspr_wait_how_e waithow)
{
pid_t pstatus;
int waitpid_options = WUNTRACED;
int exit_int;
int ignore;
apr_exit_why_e ignorewhy;
fspr_exit_why_e ignorewhy;
if (exitcode == NULL) {
exitcode = &ignore;
@@ -407,7 +407,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
return errno;
}
APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what,
APR_DECLARE(fspr_status_t) fspr_procattr_limit_set(fspr_procattr_t *attr, fspr_int32_t what,
struct rlimit *limit)
{
switch(what) {
@@ -436,7 +436,7 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr,
APR_DECLARE(fspr_status_t) fspr_procattr_user_set(fspr_procattr_t *attr,
const char *username,
const char *password)
{
@@ -444,7 +444,7 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr,
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr,
APR_DECLARE(fspr_status_t) fspr_procattr_group_set(fspr_procattr_t *attr,
const char *groupname)
{
/* Always return SUCCESS because NetWare threads don't run within a group */
+2 -2
View File
@@ -14,9 +14,9 @@
* limitations under the License.
*/
#include "apr_arch_threadproc.h"
#include "fspr_arch_threadproc.h"
apr_status_t apr_proc_detach(int daemonize)
fspr_status_t fspr_proc_detach(int daemonize)
{
#if 0
int x;
+11 -11
View File
@@ -14,29 +14,29 @@
* limitations under the License.
*/
#include "apr_arch_threadproc.h"
#include "fspr_arch_threadproc.h"
#include <nks/thread.h>
#include "apr_private.h"
#include "apr_pools.h"
#include "apr_signal.h"
#include "apr_strings.h"
#include "fspr_private.h"
#include "fspr_pools.h"
#include "fspr_signal.h"
#include "fspr_strings.h"
#include <assert.h>
#if APR_HAS_THREADS && APR_HAVE_PTHREAD_H
#include <pthread.h>
#endif
APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum)
APR_DECLARE(fspr_status_t) fspr_proc_kill(fspr_proc_t *proc, int signum)
{
return APR_ENOTIMPL;
}
void apr_signal_init(apr_pool_t *pglobal)
void fspr_signal_init(fspr_pool_t *pglobal)
{
}
const char *apr_signal_description_get(int signum)
const char *fspr_signal_description_get(int signum)
{
switch (signum)
{
@@ -64,19 +64,19 @@ static void *signal_thread_func(void *signal_handler)
return NULL;
}
APR_DECLARE(apr_status_t) apr_setup_signal_thread(void)
APR_DECLARE(fspr_status_t) fspr_setup_signal_thread(void)
{
int rv = 0;
return rv;
}
APR_DECLARE(apr_status_t) apr_signal_block(int signum)
APR_DECLARE(fspr_status_t) fspr_signal_block(int signum)
{
return APR_ENOTIMPL;
}
APR_DECLARE(apr_status_t) apr_signal_unblock(int signum)
APR_DECLARE(fspr_status_t) fspr_signal_unblock(int signum)
{
return APR_ENOTIMPL;
}
+50 -50
View File
@@ -14,18 +14,18 @@
* limitations under the License.
*/
#include "apr.h"
#include "apr_portable.h"
#include "apr_strings.h"
#include "apr_arch_threadproc.h"
#include "fspr.h"
#include "fspr_portable.h"
#include "fspr_strings.h"
#include "fspr_arch_threadproc.h"
static int thread_count = 0;
apr_status_t apr_threadattr_create(apr_threadattr_t **new,
apr_pool_t *pool)
fspr_status_t fspr_threadattr_create(fspr_threadattr_t **new,
fspr_pool_t *pool)
{
(*new) = (apr_threadattr_t *)apr_palloc(pool,
sizeof(apr_threadattr_t));
(*new) = (fspr_threadattr_t *)fspr_palloc(pool,
sizeof(fspr_threadattr_t));
if ((*new) == NULL) {
return APR_ENOMEM;
@@ -38,45 +38,45 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new,
return APR_SUCCESS;
}
apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr,apr_int32_t on)
fspr_status_t fspr_threadattr_detach_set(fspr_threadattr_t *attr,fspr_int32_t on)
{
attr->detach = on;
return APR_SUCCESS;
}
apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr)
fspr_status_t fspr_threadattr_detach_get(fspr_threadattr_t *attr)
{
if (attr->detach == 1)
return APR_DETACH;
return APR_NOTDETACH;
}
APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
apr_size_t stacksize)
APR_DECLARE(fspr_status_t) fspr_threadattr_stacksize_set(fspr_threadattr_t *attr,
fspr_size_t stacksize)
{
attr->stack_size = stacksize;
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
apr_size_t size)
APR_DECLARE(fspr_status_t) fspr_threadattr_guardsize_set(fspr_threadattr_t *attr,
fspr_size_t size)
{
return APR_ENOTIMPL;
}
static void *dummy_worker(void *opaque)
{
apr_thread_t *thd = (apr_thread_t *)opaque;
fspr_thread_t *thd = (fspr_thread_t *)opaque;
return thd->func(thd, thd->data);
}
apr_status_t apr_thread_create(apr_thread_t **new,
apr_threadattr_t *attr,
apr_thread_start_t func,
fspr_status_t fspr_thread_create(fspr_thread_t **new,
fspr_threadattr_t *attr,
fspr_thread_start_t func,
void *data,
apr_pool_t *pool)
fspr_pool_t *pool)
{
apr_status_t stat;
fspr_status_t stat;
long flags = NX_THR_BIND_CONTEXT;
char threadName[NX_MAX_OBJECT_NAME_LEN+1];
size_t stack_size = APR_DEFAULT_STACK_SIZE;
@@ -97,7 +97,7 @@ apr_status_t apr_thread_create(apr_thread_t **new,
stack_size = attr->stack_size;
}
(*new) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t));
(*new) = (fspr_thread_t *)fspr_palloc(pool, sizeof(fspr_thread_t));
if ((*new) == NULL) {
return APR_ENOMEM;
@@ -106,9 +106,9 @@ apr_status_t apr_thread_create(apr_thread_t **new,
(*new)->pool = pool;
(*new)->data = data;
(*new)->func = func;
(*new)->thread_name = (char*)apr_pstrdup(pool, threadName);
(*new)->thread_name = (char*)fspr_pstrdup(pool, threadName);
stat = apr_pool_create(&(*new)->pool, pool);
stat = fspr_pool_create(&(*new)->pool, pool);
if (stat != APR_SUCCESS) {
return stat;
}
@@ -141,34 +141,34 @@ apr_status_t apr_thread_create(apr_thread_t **new,
return(stat);// if error
}
apr_os_thread_t apr_os_thread_current()
fspr_os_thread_t fspr_os_thread_current()
{
return NXThreadGetId();
}
int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2)
int fspr_os_thread_equal(fspr_os_thread_t tid1, fspr_os_thread_t tid2)
{
return (tid1 == tid2);
}
void apr_thread_yield()
void fspr_thread_yield()
{
NXThreadYield();
}
apr_status_t apr_thread_exit(apr_thread_t *thd,
apr_status_t retval)
fspr_status_t fspr_thread_exit(fspr_thread_t *thd,
fspr_status_t retval)
{
thd->exitval = retval;
apr_pool_destroy(thd->pool);
fspr_pool_destroy(thd->pool);
NXThreadExit(NULL);
return APR_SUCCESS;
}
apr_status_t apr_thread_join(apr_status_t *retval,
apr_thread_t *thd)
fspr_status_t fspr_thread_join(fspr_status_t *retval,
fspr_thread_t *thd)
{
apr_status_t stat;
fspr_status_t stat;
NXThreadId_t dthr;
if ((stat = NXThreadJoin(thd->td, &dthr, NULL)) == 0) {
@@ -180,16 +180,16 @@ apr_status_t apr_thread_join(apr_status_t *retval,
}
}
apr_status_t apr_thread_detach(apr_thread_t *thd)
fspr_status_t fspr_thread_detach(fspr_thread_t *thd)
{
return APR_SUCCESS;
}
apr_status_t apr_thread_data_get(void **data, const char *key,
apr_thread_t *thread)
fspr_status_t fspr_thread_data_get(void **data, const char *key,
fspr_thread_t *thread)
{
if (thread != NULL) {
return apr_pool_userdata_get(data, key, thread->pool);
return fspr_pool_userdata_get(data, key, thread->pool);
}
else {
data = NULL;
@@ -197,12 +197,12 @@ apr_status_t apr_thread_data_get(void **data, const char *key,
}
}
apr_status_t apr_thread_data_set(void *data, const char *key,
apr_status_t (*cleanup) (void *),
apr_thread_t *thread)
fspr_status_t fspr_thread_data_set(void *data, const char *key,
fspr_status_t (*cleanup) (void *),
fspr_thread_t *thread)
{
if (thread != NULL) {
return apr_pool_userdata_set(data, key, cleanup, thread->pool);
return fspr_pool_userdata_set(data, key, cleanup, thread->pool);
}
else {
data = NULL;
@@ -210,8 +210,8 @@ apr_status_t apr_thread_data_set(void *data, const char *key,
}
}
APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd,
apr_thread_t *thd)
APR_DECLARE(fspr_status_t) fspr_os_thread_get(fspr_os_thread_t **thethd,
fspr_thread_t *thd)
{
if (thd == NULL) {
return APR_ENOTHREAD;
@@ -220,29 +220,29 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd,
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd,
apr_os_thread_t *thethd,
apr_pool_t *pool)
APR_DECLARE(fspr_status_t) fspr_os_thread_put(fspr_thread_t **thd,
fspr_os_thread_t *thethd,
fspr_pool_t *pool)
{
if (pool == NULL) {
return APR_ENOPOOL;
}
if ((*thd) == NULL) {
(*thd) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t));
(*thd) = (fspr_thread_t *)fspr_palloc(pool, sizeof(fspr_thread_t));
(*thd)->pool = pool;
}
(*thd)->td = *thethd;
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control,
apr_pool_t *p)
APR_DECLARE(fspr_status_t) fspr_thread_once_init(fspr_thread_once_t **control,
fspr_pool_t *p)
{
(*control) = apr_pcalloc(p, sizeof(**control));
(*control) = fspr_pcalloc(p, sizeof(**control));
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control,
APR_DECLARE(fspr_status_t) fspr_thread_once(fspr_thread_once_t *control,
void (*func)(void))
{
if (!atomic_xchg(&control->value, 1)) {
+23 -23
View File
@@ -14,15 +14,15 @@
* limitations under the License.
*/
#include "apr_portable.h"
#include "apr_arch_threadproc.h"
#include "fspr_portable.h"
#include "fspr_arch_threadproc.h"
apr_status_t apr_threadkey_private_create(apr_threadkey_t **key,
void (*dest)(void *), apr_pool_t *pool)
fspr_status_t fspr_threadkey_private_create(fspr_threadkey_t **key,
void (*dest)(void *), fspr_pool_t *pool)
{
apr_status_t stat;
fspr_status_t stat;
(*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t));
(*key) = (fspr_threadkey_t *)fspr_palloc(pool, sizeof(fspr_threadkey_t));
if ((*key) == NULL) {
return APR_ENOMEM;
}
@@ -35,9 +35,9 @@ apr_status_t apr_threadkey_private_create(apr_threadkey_t **key,
return stat;
}
apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key)
fspr_status_t fspr_threadkey_private_get(void **new, fspr_threadkey_t *key)
{
apr_status_t stat;
fspr_status_t stat;
if ((stat = NXKeyGetValue(key->key, new)) == 0) {
return APR_SUCCESS;
@@ -47,9 +47,9 @@ apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key)
}
}
apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key)
fspr_status_t fspr_threadkey_private_set(void *priv, fspr_threadkey_t *key)
{
apr_status_t stat;
fspr_status_t stat;
if ((stat = NXKeySetValue(key->key, priv)) == 0) {
return APR_SUCCESS;
}
@@ -58,42 +58,42 @@ apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key)
}
}
apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key)
fspr_status_t fspr_threadkey_private_delete(fspr_threadkey_t *key)
{
apr_status_t stat;
fspr_status_t stat;
if ((stat = NXKeyDelete(key->key)) == 0) {
return APR_SUCCESS;
}
return stat;
}
apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey)
fspr_status_t fspr_threadkey_data_get(void **data, const char *key, fspr_threadkey_t *threadkey)
{
return apr_pool_userdata_get(data, key, threadkey->pool);
return fspr_pool_userdata_get(data, key, threadkey->pool);
}
apr_status_t apr_threadkey_data_set(void *data,
const char *key, apr_status_t (*cleanup) (void *),
apr_threadkey_t *threadkey)
fspr_status_t fspr_threadkey_data_set(void *data,
const char *key, fspr_status_t (*cleanup) (void *),
fspr_threadkey_t *threadkey)
{
return apr_pool_userdata_set(data, key, cleanup, threadkey->pool);
return fspr_pool_userdata_set(data, key, cleanup, threadkey->pool);
}
apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey,
apr_threadkey_t *key)
fspr_status_t fspr_os_threadkey_get(fspr_os_threadkey_t *thekey,
fspr_threadkey_t *key)
{
thekey = &(key->key);
return APR_SUCCESS;
}
apr_status_t apr_os_threadkey_put(apr_threadkey_t **key,
apr_os_threadkey_t *thekey, apr_pool_t *pool)
fspr_status_t fspr_os_threadkey_put(fspr_threadkey_t **key,
fspr_os_threadkey_t *thekey, fspr_pool_t *pool)
{
if (pool == NULL) {
return APR_ENOPOOL;
}
if ((*key) == NULL) {
(*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t));
(*key) = (fspr_threadkey_t *)fspr_palloc(pool, sizeof(fspr_threadkey_t));
(*key)->pool = pool;
}
(*key)->key = *thekey;