fastlock.h File Reference

Assembler routines for fast architecture dependend locking. More...

#include <unistd.h>

Include dependency graph for fastlock.h:

Go to the source code of this file.

Defines

#define init_lock(l)   (l)=0
#define sched_yield()   sleep(0)

Typedefs

typedef volatile int fl_lock_t

Functions

static void get_lock (fl_lock_t *lock)
 Set a lock.
static void release_lock (fl_lock_t *lock)
 Release a lock.
static int tsl (fl_lock_t *lock)
 Test and set a lock. Used by the get_lock function.


Detailed Description

Assembler routines for fast architecture dependend locking.

Contains the assembler routines for the fast architecture dependend locking primitives used by the server. This routines are needed e.g. to protect shared data structures that are accessed from muliple processes.

Todo:
replace this with the assembler routines provided by the linux kernel

Definition in file fastlock.h.


Define Documentation

#define init_lock (  )     (l)=0

Initialize a lock, zero is unlocked.

Definition at line 63 of file fastlock.h.

 
#define sched_yield (  )     sleep(0)

Fake sched_yield if no unistd.h include is available

Definition at line 56 of file fastlock.h.

Referenced by get_lock().


Typedef Documentation

typedef volatile int fl_lock_t

The actual lock

Definition at line 60 of file fastlock.h.


Function Documentation

static void get_lock ( fl_lock_t lock  )  [inline, static]

Set a lock.

Parameters:
lock the lock that should be set
See also:
tsl

Definition at line 172 of file fastlock.h.

References sched_yield, and tsl().

Referenced by destroy_linkers(), get_profile_size(), link_dlg_profile(), and mi_profile_list().

static void release_lock ( fl_lock_t lock  )  [inline, static]

Release a lock.

Parameters:
lock the lock that should be released

Definition at line 194 of file fastlock.h.

Referenced by destroy_linkers(), get_profile_size(), link_dlg_profile(), and mi_profile_list().

static int tsl ( fl_lock_t lock  )  [inline, static]

Test and set a lock. Used by the get_lock function.

Parameters:
lock the lock that should be set
Returns:
1 if the lock is held by someone else, 0 otherwise
See also:
get_lock

Definition at line 73 of file fastlock.h.

Referenced by get_lock().


Generated on Wed May 23 06:01:03 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6