Back to index

glibc  2.9
Functions
pthread_key_delete.c File Reference
#include <errno.h>
#include "pthreadP.h"
#include <atomic.h>

Go to the source code of this file.

Functions

int pthread_key_delete (pthread_key_t key)

Function Documentation

Definition at line 26 of file pthread_key_delete.c.

{
  int result = EINVAL;

  if (__builtin_expect (key < PTHREAD_KEYS_MAX, 1))
    {
      unsigned int seq = __pthread_keys[key].seq;

      if (__builtin_expect (! KEY_UNUSED (seq), 1)
         && ! atomic_compare_and_exchange_bool_acq (&__pthread_keys[key].seq,
                                               seq + 1, seq))
       /* We deleted a valid key.  */
       result = 0;
    }

  return result;
}

Here is the call graph for this function: