Added lock files

This commit is contained in:
Ross Owen
2012-03-05 13:15:21 +00:00
parent d4df4f7c07
commit a5430bfa1b
2 changed files with 80 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
/** @file lock.h
* @brief Functions for using hardware locks
* @author Ross Owen, XMOS Limited
*/
#ifndef _LOCK_H_
#define _LOCK_H_ 1
typedef unsigned lock;
/* Allocates and returns a lock resource - returns 0 if out of lock */
lock GetLockResource() ;
/* Claims the passed lock, this is a blocking call */
void ClaimLock(lock l);
/* Frees the passed lock */
void FreeLock(lock l);
/* De-allocated the passed lock resource */
void FreeLockResource(lock l);
#endif