Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 17 Data Types and Structures

ldap_extra_thread_fns

The ldap_extra_thread_fns structure contains a set of pointers to additional functions that you want to use when write a multithreaded client. Your client calls these functions when getting results from the LDAP structure.

After you set the fields in this structure, you can register the functions in this structure for use by the client by calling the ldap_set_option() function and set the LDAP_OPT_EXTRA_THREAD_FN_PTRS option to this structure.

The ldap_extra_thread_fns structure is defined as follows:

struct ldap_extra_thread_fns {
   LDAP_TF_MUTEX_TRYLOCK_CALLBACK *ltf_mutex_trylock;
   LDAP_TF_SEMA_ALLOC_CALLBACK *ltf_sema_alloc;
   LDAP_TF_SEMA_FREE_CALLBACK *ltf_sema_free;
   LDAP_TF_SEMA_WAIT_CALLBACK *ltf_sema_wait;
   LDAP_TF_SEMA_POST_CALLBACK *ltf_sema_post;
};
The fields in this structure are described below:

ltf_mutex_trylock

Function pointer for attempting to lock a mutex. This function is called by the client when needed if the function pointer is not NULL. The function must have the prototype specified by LDAP_TF_MUTEX_TRYLOCK_CALLBACK.

ltf_sema_alloc

Function pointer for allocating a semaphore. This function is called by the client when needed if the function pointer is not NULL. The function must have the prototype specified by LDAP_TF_SEMA_ALLOC_CALLBACK.

ltf_sema_free

Function pointer for freeing a semaphore. This function is called by the client when needed if the function pointer is not NULL. The function must have the prototype specified by LDAP_TF_SEMA_FREE_CALLBACK.

ltf_sema_wait

Function pointer for waiting for the value of a semaphore to be greater than 0. This function is called by the client when needed if the function pointer is not NULL. The function must have the prototype specified by LDAP_TF_SEMA_WAIT_CALLBACK.

ltf_sema_post

Function pointer for incrementing the value of a semaphore. This function is called by the client when needed if the function pointer is not NULL.

The function must have the prototype specified by LDAP_TF_SEMA_POST_CALLBACK.

For an example of setting up the ldap_extra_thread_fns structure, see Chapter 16, "Writing Multithreaded Clients."


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:05:28