Back to index

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

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 old;

  __asm __volatile ("cs %0,%3,%1"
                  : "=d" (old), "=Q" (*lock)
                  : "0" (0), "d" (1), "m" (*lock) : "cc" );

  return old != 0 ? EBUSY : 0;
}