version 1.6, 2006/11/10 18:14:58
|
version 1.7, 2007/01/09 03:48:40
|
|
|
#define Pegasus_SpinLock_h | #define Pegasus_SpinLock_h |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
|
#include <Pegasus/Common/Linkage.h> |
| |
//============================================================================== | //============================================================================== |
// | // |
|
|
| |
// This array defines spin locks shared across the system. These are | // This array defines spin locks shared across the system. These are |
// initialized by calling SpinLockCreatePool(). | // initialized by calling SpinLockCreatePool(). |
|
PEGASUS_COMMON_LINKAGE |
extern SpinLock spinLockPool[PEGASUS_NUM_SHARED_SPIN_LOCKS]; | extern SpinLock spinLockPool[PEGASUS_NUM_SHARED_SPIN_LOCKS]; |
| |
// This flag is 0 until SpinLockCreatePool() is called, which sets it | // This flag is 0 until SpinLockCreatePool() is called, which sets it |
// to 1. | // to 1. |
extern int spinLockPoolInitialized; |
PEGASUS_COMMON_LINKAGE extern int spinLockPoolInitialized; |
| |
// Initializes the global pool of mutexes. | // Initializes the global pool of mutexes. |
void SpinLockCreatePool(); |
PEGASUS_COMMON_LINKAGE void SpinLockCreatePool(); |
| |
// Maps an address into the spinLockPool[] array defined above. This is used | // Maps an address into the spinLockPool[] array defined above. This is used |
// to assign objects (by their addresses) to a shared lock. Collisions are | // to assign objects (by their addresses) to a shared lock. Collisions are |