Back to index

glibc  2.9
Defines | Typedefs | Functions
machine-lock.h File Reference

Go to the source code of this file.

Defines

#define __SPIN_LOCK_INITIALIZER   0
#define _EXTERN_INLINE   __extern_inline

Typedefs

typedef __volatile int __spin_lock_t

Functions

_EXTERN_INLINE void __spin_unlock (__spin_lock_t *__lock)
_EXTERN_INLINE int __spin_try_lock (__spin_lock_t *__lock)
_EXTERN_INLINE int __spin_lock_locked (__spin_lock_t *__lock)

Define Documentation

#define __SPIN_LOCK_INITIALIZER   0

Definition at line 29 of file machine-lock.h.

Definition at line 33 of file machine-lock.h.


Typedef Documentation

Definition at line 25 of file machine-lock.h.


Function Documentation

Definition at line 62 of file machine-lock.h.

{
  return *__lock != 0;
}

Definition at line 50 of file machine-lock.h.

{
  register int __locked;
  __asm__ __volatile ("xchgl %0, %1"
                    : "=&r" (__locked), "=m" (*__lock) : "0" (1)
                    : "memory");
  return !__locked;
}

Here is the call graph for this function:

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

{
   register int __unlocked;
   __asm__ __volatile ("xchgl %0, %1"
                     : "=&r" (__unlocked), "=m" (*__lock) : "0" (0)
                     : "memory");
}

Here is the call graph for this function: