DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

suds_unlock(S)


suds_unlock -- release a spin lock previously obtained by suds_lock or suds_try

Syntax

cc . . . -lsuds
#include <sys/semaphore.h>

int suds_unlock(struct suds_lock *lock_addr);

Description

The suds_unlock function is used to release a lock that has been obtained by calling suds_lock(S) or suds_locktry(S). Once the lock has been released, another process will be able to obtain that lock with suds_lock or suds_try. Locks may be unlocked in a different order to that in which they were locked.

Return values

Upon successful completion, the function returns 0. Otherwise -1 is returned and errno is set accordingly.

Diagnostics


[EINVAL]
The specified address of the lock is not a valid lock address.

Examples

The following code shows an application using two locks to protect critical sections of code.
   suds_lock(&lock_1);
   /* access resource protected with lock_1 */
   suds_lock(&lock_2);
   /* access resource protected with lock_1 and lock_2 */
   suds_unlock(&lock_1);
   /* access resource protected with lock_2 */
   suds_unlock(&lock_2);

See also

suds_ctrl(ADM), suds_lockinit(S), suds_lock(S), suds_lockstate(S), suds_locktry(S), suds_shmat(S)

Standards conformance

suds_unlock is not part of any currently supported standard; it is an extension of AT&T System V provided by The Santa Cruz Operation, Inc.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003