HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
Parameters This function takes the following parameter:
Contains arguments to passed to the task.
arg
51.2 slapi_new_task()
Creates a new server task and returns a pointer to the Slapi_Task structure.
Syntax
Slapi_Task *slapi_new_task(const char *dn)
Parameters This function takes the following parameter:
The DN of the task entry that was defined for this instance of the task. This DN is used
by the task process to identify the appropriate task configuration entry so the process
can write log and status messages.
dn
51.3 slapi_task_begin()
Updates the task entry state to indicate that the task is running. Call this as soon as necessary to
begin performing the work for the custom task.
Syntax
void slapi_task_begin(Slapi_Task *task, int total_work)
Parameters This function takes the following parameters:
Points to the task operation which is being performed by the server.
task
Gives the total number of work items needed to complete the task. This can be used to
update the task status with partial progress as the task runs.
total_work
51.4 slapi_task_cancel()
Called to cancel a task. This function updates the state attributes in the task configuration entry
to record that the task is canceled and returns a result code to the user. slapi_task_cancel()
queues an event to destroy the task, which frees the task itself as well as any cleanup defined in
a custom destructor callback function.
Syntax
void slapi_task_cancel(Slapi_Task *task, int rc)
Parameters This function takes the following parameters:
Points to the task operation which is being performed by the server.
task
Contains the result code to set for the task.
rc
See also
slapi_task_finish()
51.5 slapi_task_dec_refcount()
Decrements the task reference count to prevent freeing any shared data before the threads are
finished with it.
Reference counts are used by tasks which initiate multiple threads.
Syntax
void slapi_task_dec_refcount(Slapi_Task *task)
378 Functions for server tasks