upc_lock_free

Date:

09-23-2013

NAME

upc_lock_free - Frees all resources associated with the dynamically allocated upc_lock_t

SYNOPSIS

#include <upc.h>

void upc_lock_free(upc_lock_t *ptr);

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

The upc_lock_free function frees all resources associated with the dynamically allocated upc_lock_t pointed to by ptr. If ptr is a null pointer, no action occurs. Otherwise, if the argument does not match a pointer earlier returned by the upc_global_lock_alloc or upc_all_lock_alloc function, or if the lock has been deallocated by a previous call to upc_lock_free, the behavior is undefined.

The upc_lock_free call succeeds regardless of whether the referenced lock is currently unlocked or currently locked (by any thread).

Any subsequent calls to locking functions from any threads using ptr have undefined effects.

Note: While upc_all_lock_alloc is a collective function, upc_lock_free is not. Only one UPC thread should call upc_lock_free to deallocate memory. If multiple UPC threads attempt to call upc_lock_free to deallocate the same memory, a runtime error results.

SEE ALSO

SEE ALSO

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