Thread portability Routines

Overview

// global functions

apr_status_t
apr_os_thread_get(
    apr_os_thread_t** thethd,
    apr_thread_t* thd
);

apr_status_t
apr_os_threadkey_get(
    apr_os_threadkey_t* thekey,
    apr_threadkey_t* key
);

apr_status_t
apr_os_thread_put(
    apr_thread_t** thd,
    apr_os_thread_t* thethd,
    apr_pool_t* cont
);

apr_status_t
apr_os_threadkey_put(
    apr_threadkey_t** key,
    apr_os_threadkey_t* thekey,
    apr_pool_t* cont
);

apr_os_thread_t
apr_os_thread_current(void);

int
apr_os_thread_equal(
    apr_os_thread_t tid1,
    apr_os_thread_t tid2
);

Detailed Documentation

Global Functions

apr_status_t
apr_os_thread_get(
    apr_os_thread_t** thethd,
    apr_thread_t* thd
)

convert the thread to os specific type from apr type.

Parameters:

thethd

The apr thread to convert

thd

The os specific thread we are converting to

apr_status_t
apr_os_threadkey_get(
    apr_os_threadkey_t* thekey,
    apr_threadkey_t* key
)

convert the thread private memory key to os specific type from an apr type.

Parameters:

thekey

The apr handle we are converting from.

key

The os specific handle we are converting to.

apr_status_t
apr_os_thread_put(
    apr_thread_t** thd,
    apr_os_thread_t* thethd,
    apr_pool_t* cont
)

convert the thread from os specific type to apr type.

Parameters:

thd

The apr thread we are converting to.

thethd

The os specific thread to convert

cont

The pool to use if it is needed.

apr_status_t
apr_os_threadkey_put(
    apr_threadkey_t** key,
    apr_os_threadkey_t* thekey,
    apr_pool_t* cont
)

convert the thread private memory key from os specific type to apr type.

Parameters:

key

The apr handle we are converting to.

thekey

The os specific handle to convert

cont

The pool to use if it is needed.

apr_os_thread_t
apr_os_thread_current(void)

Get the thread ID

int
apr_os_thread_equal(
    apr_os_thread_t tid1,
    apr_os_thread_t tid2
)

Compare two thread id’s

Parameters:

tid1

1st Thread ID to compare

tid2

2nd Thread ID to compare

Returns:

non-zero if the two threads are equal, zero otherwise