Back to index

php5  5.3.10
Defines | Functions
fpm_atomic.h File Reference
#include <stdint.h>
#include <sched.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define fpm_unlock(lock)   lock = 0

Functions

static int fpm_spinlock (atomic_t *lock, int try_once)

Define Documentation

#define fpm_unlock (   lock)    lock = 0

Definition at line 165 of file fpm_atomic.h.


Function Documentation

static int fpm_spinlock ( atomic_t *  lock,
int  try_once 
) [inline, static]

Definition at line 146 of file fpm_atomic.h.

{
       if (try_once) {
              return atomic_cmp_set(lock, 0, 1) ? 1 : 0;
       }

       for (;;) {

              if (atomic_cmp_set(lock, 0, 1)) {
                     break;
              }

              sched_yield();
       }

       return 1;
}

Here is the caller graph for this function: