add overridable locking functions

This commit is contained in:
Dave Murphy 2010-05-16 11:17:43 +00:00
parent 7f396f52d4
commit fd85021971
2 changed files with 33 additions and 19 deletions

29
source/lock.c Normal file
View File

@ -0,0 +1,29 @@
#include "common.h"
#ifndef USE_LWP_LOCK
#ifndef mutex_t
typedef int mutex_t;
#endif
void __attribute__ ((weak)) _FAT_lock_init(mutex_t *mutex)
{
return;
}
void __attribute__ ((weak)) _FAT_lock_deinit(mutex_t *mutex)
{
return;
}
void __attribute__ ((weak)) _FAT_lock(mutex_t *mutex)
{
return;
}
void __attribute__ ((weak)) _FAT_unlock(mutex_t *mutex)
{
return;
}
#endif // USE_LWP_LOCK

View File

@ -60,25 +60,10 @@ static inline void _FAT_unlock(mutex_t *mutex)
typedef int mutex_t; typedef int mutex_t;
#endif #endif
static inline void _FAT_lock_init(mutex_t *mutex) void _FAT_lock_init(mutex_t *mutex);
{ void _FAT_lock_deinit(mutex_t *mutex);
return; void _FAT_lock(mutex_t *mutex);
} void _FAT_unlock(mutex_t *mutex);
static inline void _FAT_lock_deinit(mutex_t *mutex)
{
return;
}
static inline void _FAT_lock(mutex_t *mutex)
{
return;
}
static inline void _FAT_unlock(mutex_t *mutex)
{
return;
}
#endif // USE_LWP_LOCK #endif // USE_LWP_LOCK