4f5f1b3c0c
Still needs woork to properly enable logging and extra settings. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6983 a95241bf-73f2-0310-859d-f6bbb57e9c96
27 lines
488 B
C
27 lines
488 B
C
/*
|
|
Copyright (c) 2002, Thomas Kurschel
|
|
|
|
|
|
Part of Radeon driver
|
|
|
|
Benaphore definition
|
|
*/
|
|
|
|
|
|
#ifndef _BENAPHORE_H
|
|
#define _BENAPHORE_H
|
|
|
|
|
|
typedef struct {
|
|
sem_id sem;
|
|
int32 ben;
|
|
} benaphore;
|
|
|
|
|
|
#define INIT_BEN(prefix, x) x.sem = create_sem(0, #prefix " benaphore"); x.ben = 0;
|
|
#define ACQUIRE_BEN(x) if((atomic_add(&(x.ben), 1)) >= 1) acquire_sem(x.sem);
|
|
#define RELEASE_BEN(x) if((atomic_add(&(x.ben), -1)) > 1) release_sem(x.sem);
|
|
#define DELETE_BEN(x) delete_sem(x.sem);
|
|
|
|
#endif
|