|
|
#include <sys/semaphore.h>int suds_lockinit(struct *suds_lock lock_addr);
The lock specified by lock_addr will be set to the unlocked state, so that the first attempt to obtain that lock in the future will succeed. A lock should only be initialized once. A process, or any of its parents, must have used the suds_lockinit function prior to using the functions suds_lock(S-osr5), suds_unlock(S-osr5), or suds_locktry(S-osr5). If a process needs to call suds_lockinit without specifying a lock, so as to fulfill this requirement, then a NULL pointer may be specified as the address of a lock.
struct suds_lock lock_all; . . . suds_lockinit(&lock_all); . . . suds_lock(&lock_all);The second example shows code fragment where a process wishes to use locks that have already been initialized by other processes:
suds_lockinit(NULL); . . . suds_lock(&lock_all);The suds family of calls cannot be used until the appropriate permissions have been granted using the suds_ctrl(ADM) function.