Use enum to define key types.

Suggested by:	jmallett
This commit is contained in:
David Xu 2010-01-09 06:30:40 +00:00
parent 4904f91fe0
commit 73532aa78c

View File

@ -58,14 +58,16 @@ __FBSDID("$FreeBSD$");
#include <compat/freebsd32/freebsd32_proto.h>
#endif
#define TYPE_SIMPLE_WAIT 0
#define TYPE_CV (TYPE_SIMPLE_WAIT+1)
#define TYPE_SEM (TYPE_CV+1)
#define TYPE_SIMPLE_LOCK (TYPE_SEM+1)
#define TYPE_NORMAL_UMUTEX (TYPE_SIMPLE_LOCK+1)
#define TYPE_PI_UMUTEX (TYPE_NORMAL_UMUTEX+1)
#define TYPE_PP_UMUTEX (TYPE_PI_UMUTEX+1)
#define TYPE_RWLOCK (TYPE_PP_UMUTEX+1)
enum {
TYPE_SIMPLE_WAIT,
TYPE_CV,
TYPE_SEM,
TYPE_SIMPLE_LOCK,
TYPE_NORMAL_UMUTEX,
TYPE_PI_UMUTEX,
TYPE_PP_UMUTEX,
TYPE_RWLOCK
};
#define _UMUTEX_TRY 1
#define _UMUTEX_WAIT 2