Removing unused BeOS compatibility header.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33241 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2009-09-23 02:26:54 +00:00
parent 8b6349fd32
commit ecd60dec1a
@@ -1,50 +0,0 @@
/*
Driver for USB Human Interface Devices.
Copyright (C) 2008 Michael Lotz <[email protected]>
Distributed under the terms of the MIT license.
*/
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
#ifndef _BEOS_COMPATIBILITY_H_
#define _BEOS_COMPATIBILITY_H_
#include <OS.h>
typedef struct mutex {
sem_id sem;
int32 count;
} mutex;
static inline void
mutex_init(mutex *lock, const char *name)
{
lock->sem = create_sem(0, name);
lock->count = 0;
}
static inline void
mutex_destroy(mutex *lock)
{
delete_sem(lock->sem);
}
static inline status_t
mutex_lock(mutex *lock)
{
if (atomic_add(&lock->count, -1) < 0)
return acquire_sem(lock->sem);
return B_OK;
}
static inline void
mutex_unlock(mutex *lock)
{
if (atomic_add(&lock->count, 1) < -1)
release_sem(lock->sem);
}
#endif /* !HAIKU_TARGET_PLATFORM_HAIKU */
#endif /* _BEOS_COMPATIBILITY_H_ */