Subversion Repositories HelenOS

Rev

Rev 2071 | Rev 2089 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2071 Rev 2085
Line 38... Line 38...
38
#include <arch/types.h>
38
#include <arch/types.h>
39
#include <typedefs.h>
39
#include <typedefs.h>
40
#include <synch/semaphore.h>
40
#include <synch/semaphore.h>
41
#include <synch/synch.h>
41
#include <synch/synch.h>
42
 
42
 
43
struct mutex {
43
typedef struct {
44
    semaphore_t sem;
44
    semaphore_t sem;
45
};
45
} mutex_t;
46
 
46
 
47
#define mutex_lock(mtx) \
47
#define mutex_lock(mtx) \
48
    _mutex_lock_timeout((mtx),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE)
48
    _mutex_lock_timeout((mtx),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE)
49
#define mutex_trylock(mtx) \
49
#define mutex_trylock(mtx) \
50
    _mutex_lock_timeout((mtx),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NON_BLOCKING)
50
    _mutex_lock_timeout((mtx),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NON_BLOCKING)