When called from within a multi-threaded program, it initialises the lpf_init_t object for use with lpf_hook(). All threads that are supposed to join in the lpf_hook() are required to call this function collectively with a private memory location for init . An obvious use for this function is to allow existing multi-threaded applications to use LPF codes.
- Parameters
-
| [in] | pid | The same id that this thread will get when lpf_hook() is called. |
| [in] | nprocs | The number of threads that call this function and the subsequent call to lpf_hook(). |
| [out] | init | The lpf_init_t init object that can be used through lpf_hook(). The memory location for this variable can but is not required to be shared between threads. |
- Returns
- LPF_SUCCESS at successful initialization.
-
LPF_ERR_OUT_OF_MEMORY when there wasn't enough memory.
-
LPF_ERR_FATAL when the system encountered an unrecoverable error.