////////////////////////////////////////////////////////////////////////////////// // File : spin_lock.h // Date : 01/04/2012 // Author : alain greiner // Copyright (c) UPMC-LIP6 /////////////////////////////////////////////////////////////////////////////////// #ifndef _GIET_SPIN_LOCK_H_ #define _GIET_SPIN_LOCK_H_ /////////////////////////////////////////////////////////////////////////////////// // lock structure // This is a simple binary lock (without waiting queue). /////////////////////////////////////////////////////////////////////////////////// typedef struct giet_lock_s { char name[32]; // lock name unsigned int value; // taken if value != 0 } giet_lock_t; ////////////////////////////////////////////////////////////////////////////// // access functions ////////////////////////////////////////////////////////////////////////////// void lock_acquire(giet_lock_t * lock); void lock_release(giet_lock_t * lock); #endif // Local Variables: // tab-width: 4 // c-basic-offset: 4 // c-file-offsets:((innamespace . 0)(inline-open . 0)) // indent-tabs-mode: nil // End: // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4