## The `upc_lock_free` function

#### Synopsis

        #include <upc.h>
        upc_lock_t *upc_lock_free(upc_lock_t *ptr);

#### 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.

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

Any subsequent calls to locking functions from any thread using `ptr` have undefined effects. This also applies to any thread currently calling `upc_lock`.

Terms, definitions, and symbols

Back to index of all UPC functions