Back to index

glibc  2.9
Functions
pthread_spin_trylock.c File Reference
#include <errno.h>
#include "pthreadP.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int pthread_spin_trylock (pthread_spinlock_t *lock)

Function Documentation

int pthread_spin_trylock ( pthread_spinlock_t *  lock)

Definition at line 24 of file pthread_spin_trylock.c.

{
  int res;
  __asm __volatile
    ("ldstub [%1], %0\n"
     "membar #StoreLoad | #StoreStore"
     : "=r" (res)
     : "r" (lock)
     : "memory");
  return res == 0 ? 0 : EBUSY;
}