upc_lock_attempt

Date:

09-23-2013

NAME

upc_lock_attempt - Tries to lock a shared variable

SYNOPSIS

#include <upc.h>

int upc_lock_attempt(upc_lock_t *ptr);

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

The upc_lock_attempt function tries to lock a shared variable, of type upc_lock_t, pointed to by the pointer given as argument. If the lock is not used by another thread, then the thread making the call gets the lock and the function returns 1. Otherwise, the function returns 0. A null strict reference is implied after a call to upc_lock_attempt that returns 1. If the calling thread is already holding the lock referenced by ptr (that is, it has previously locked it using upc_lock or upc_lock_attempt but not unlocked it), the result is undefined.

SEE ALSO

upc_all_lock_alloc(3c), upc_global_lock_alloc(3c), upc_lock(3c), upc_lock_free(3c), upc_lock_t(3c), upc_unlock(3c)