Back to index

glibc  2.9
Defines | Functions
pthread_spin_lock.c File Reference
#include "pthreadP.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define LOCK_PREFIX   "lock;"


int pthread_spin_lock (pthread_spinlock_t *lock)

Define Documentation

#define LOCK_PREFIX   "lock;"

Definition at line 26 of file pthread_spin_lock.c.

Function Documentation

int pthread_spin_lock ( pthread_spinlock_t *  lock)

Definition at line 32 of file pthread_spin_lock.c.

  asm ("\n"
       "1:\t" LOCK_PREFIX "decl %0\n\t"
       "jne 2f\n\t"
       ".subsection 1\n\t"
       ".align 16\n"
       "2:\trep; nop\n\t"
       "cmpl $0, %0\n\t"
       "jg 1b\n\t"
       "jmp 2b\n\t"
       : "=m" (*lock)
       : "m" (*lock));

  return 0;

Here is the caller graph for this function: