Back to index

glibc  2.9
Defines | Typedefs
libc-lock.h File Reference

Go to the source code of this file.

Defines

#define __libc_lock_define(CLASS, NAME)   CLASS __libc_lock_t NAME;
#define __libc_lock_define_initialized(CLASS, NAME)   CLASS __libc_lock_t NAME = MUTEX_INITIALIZER;
#define __libc_lock_init(NAME)   __mutex_init (&(NAME))
#define __libc_lock_fini(NAME)   __mutex_unlock (&(NAME))
#define __libc_lock_fini_recursive(NAME)   __mutex_unlock (&(NAME).mutex)
#define __rtld_lock_fini_recursive(NAME)   __mutex_unlock (&(NAME).mutex)
#define __libc_lock_lock(NAME)   __mutex_lock (&(NAME))
#define __libc_lock_trylock(NAME)   (!__mutex_trylock (&(NAME)))
#define __libc_lock_unlock(NAME)   __mutex_unlock (&(NAME))
#define __libc_lock_define_recursive(CLASS, NAME)   CLASS __libc_lock_recursive_t NAME;
#define _LIBC_LOCK_RECURSIVE_INITIALIZER   { MUTEX_INITIALIZER, 0, 0 }
#define __libc_lock_define_initialized_recursive(CLASS, NAME)   CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
#define __rtld_lock_define_recursive(CLASS, NAME)   __libc_lock_define_recursive (CLASS, NAME)
#define _RTLD_LOCK_RECURSIVE_INITIALIZER   _LIBC_LOCK_RECURSIVE_INITIALIZER
#define __rtld_lock_define_initialized_recursive(CLASS, NAME)   __libc_lock_define_initialized_recursive (CLASS, NAME)
#define __libc_lock_init_recursive(NAME)
#define __libc_lock_trylock_recursive(NAME)
#define __libc_lock_lock_recursive(NAME)
#define __libc_lock_unlock_recursive(NAME)
#define __rtld_lock_init_recursive(NAME)   __libc_lock_init_recursive (NAME)
#define __rtld_lock_trylock_recursive(NAME)   __libc_lock_trylock_recursive (NAME)
#define __rtld_lock_lock_recursive(NAME)   __libc_lock_lock_recursive(NAME)
#define __rtld_lock_unlock_recursive(NAME)   __libc_lock_unlock_recursive (NAME)
#define __libc_rwlock_define   __libc_lock_define
#define __libc_rwlock_define_initialized   __libc_lock_define_initialized
#define __libc_rwlock_init   __libc_lock_init
#define __libc_rwlock_fini   __libc_lock_fini
#define __libc_rwlock_rdlock   __libc_lock_lock
#define __libc_rwlock_wrlock   __libc_lock_lock
#define __libc_rwlock_tryrdlock   __libc_lock_trylock
#define __libc_rwlock_trywrlock   __libc_lock_trylock
#define __libc_rwlock_unlock   __libc_lock_unlock
#define __libc_cleanup_region_start(DOIT, FCT, ARG)
#define __libc_cleanup_region_end(DOIT)
#define __libc_cleanup_end(DOIT)
#define __libc_cleanup_push(fct, arg)   __libc_cleanup_region_start (1, fct, arg)
#define __libc_cleanup_pop(execute)   __libc_cleanup_region_end (execute)

Typedefs

typedef struct __libc_lock_opaque__
typedef struct __libc_lock_recursive_opaque__

Define Documentation

#define __libc_cleanup_end (   DOIT)
Value:
if ((DOIT) && __save_FCT != 0)                                     \
    (*__save_FCT)(__save_ARG);                                            \

Definition at line 158 of file libc-lock.h.

#define __libc_cleanup_pop (   execute)    __libc_cleanup_region_end (execute)

Definition at line 163 of file libc-lock.h.

#define __libc_cleanup_push (   fct,
  arg 
)    __libc_cleanup_region_start (1, fct, arg)

Definition at line 162 of file libc-lock.h.

#define __libc_cleanup_region_end (   DOIT)
Value:
if ((DOIT) && __save_FCT != 0)                                     \
    (*__save_FCT)(__save_ARG);                                            \
}

Definition at line 152 of file libc-lock.h.

#define __libc_cleanup_region_start (   DOIT,
  FCT,
  ARG 
)
Value:
{                                                                  \
  typeof (***(FCT)) *__save_FCT = (DOIT) ? (FCT) : 0;                     \
  typeof (ARG) __save_ARG = ARG;                                   \
  /* close brace is in __libc_cleanup_region_end below. */

Definition at line 145 of file libc-lock.h.

#define __libc_lock_define (   CLASS,
  NAME 
)    CLASS __libc_lock_t NAME;

Definition at line 49 of file libc-lock.h.

#define __libc_lock_define_initialized (   CLASS,
  NAME 
)    CLASS __libc_lock_t NAME = MUTEX_INITIALIZER;

Definition at line 53 of file libc-lock.h.

#define __libc_lock_define_initialized_recursive (   CLASS,
  NAME 
)    CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;

Definition at line 81 of file libc-lock.h.

#define __libc_lock_define_recursive (   CLASS,
  NAME 
)    CLASS __libc_lock_recursive_t NAME;

Definition at line 78 of file libc-lock.h.

#define __libc_lock_fini (   NAME)    __mutex_unlock (&(NAME))

Definition at line 63 of file libc-lock.h.

#define __libc_lock_fini_recursive (   NAME)    __mutex_unlock (&(NAME).mutex)

Definition at line 64 of file libc-lock.h.

#define __libc_lock_init (   NAME)    __mutex_init (&(NAME))

Definition at line 58 of file libc-lock.h.

#define __libc_lock_init_recursive (   NAME)
Value:
({ __libc_lock_recursive_t *const __lock = &(NAME); \
     __lock->owner = 0; mutex_init (&__lock->mutex); })

Definition at line 91 of file libc-lock.h.

#define __libc_lock_lock (   NAME)    __mutex_lock (&(NAME))

Definition at line 69 of file libc-lock.h.

#define __libc_lock_lock_recursive (   NAME)
Value:
({ __libc_lock_recursive_t *const __lock = &(NAME);                         \
     void *__self = __libc_lock_owner_self ();                              \
     if (__mutex_trylock (&__lock->mutex)                            \
        || (__lock->owner != __self                                         \
            && (__mutex_lock (&__lock->mutex), 1)))                         \
       __lock->owner = __self, __lock->count = 1;                           \
     else                                                            \
       ++__lock->count;                                                     \
  })

Definition at line 102 of file libc-lock.h.

#define __libc_lock_trylock (   NAME)    (!__mutex_trylock (&(NAME)))

Definition at line 72 of file libc-lock.h.

#define __libc_lock_trylock_recursive (   NAME)
Value:
({ __libc_lock_recursive_t *const __lock = &(NAME);                         \
     void *__self = __libc_lock_owner_self ();                              \
     __mutex_trylock (&__lock->mutex)                                       \
     ? (__lock->owner = __self, __lock->count = 1, 0)                       \
     : __lock->owner == __self ? (++__lock->count, 0) : 1; })

Definition at line 95 of file libc-lock.h.

#define __libc_lock_unlock (   NAME)    __mutex_unlock (&(NAME))

Definition at line 75 of file libc-lock.h.

#define __libc_lock_unlock_recursive (   NAME)
Value:
({ __libc_lock_recursive_t *const __lock = &(NAME);                         \
     if (--__lock->count == 0)                                              \
       {                                                             \
        __lock->owner = 0;                                           \
        __mutex_unlock (&__lock->mutex);                             \
       }                                                             \
  })

Definition at line 112 of file libc-lock.h.

Definition at line 133 of file libc-lock.h.

Definition at line 134 of file libc-lock.h.

Definition at line 136 of file libc-lock.h.

Definition at line 135 of file libc-lock.h.

Definition at line 137 of file libc-lock.h.

Definition at line 139 of file libc-lock.h.

Definition at line 140 of file libc-lock.h.

Definition at line 141 of file libc-lock.h.

Definition at line 138 of file libc-lock.h.

#define __rtld_lock_define_initialized_recursive (   CLASS,
  NAME 
)    __libc_lock_define_initialized_recursive (CLASS, NAME)

Definition at line 88 of file libc-lock.h.

#define __rtld_lock_define_recursive (   CLASS,
  NAME 
)    __libc_lock_define_recursive (CLASS, NAME)

Definition at line 84 of file libc-lock.h.

#define __rtld_lock_fini_recursive (   NAME)    __mutex_unlock (&(NAME).mutex)

Definition at line 65 of file libc-lock.h.

#define __rtld_lock_init_recursive (   NAME)    __libc_lock_init_recursive (NAME)

Definition at line 122 of file libc-lock.h.

Definition at line 126 of file libc-lock.h.

Definition at line 124 of file libc-lock.h.

Definition at line 128 of file libc-lock.h.

#define _LIBC_LOCK_RECURSIVE_INITIALIZER   { MUTEX_INITIALIZER, 0, 0 }

Definition at line 80 of file libc-lock.h.

Definition at line 86 of file libc-lock.h.


Typedef Documentation

typedef struct __libc_lock_opaque__

Definition at line 38 of file libc-lock.h.

Definition at line 39 of file libc-lock.h.