#ifndef KERN_LOCKS_H
#define KERN_LOCKS_H

#include	<sys/cdefs.h>
#include	<sys/appleapiopts.h>
#include	<mach/boolean.h>
#include	<mach/mach_types.h>
#include	<kern/kern_types.h>
#include	<machine/locks.h>

//#include	<HYS/kern/locks.h>
#include	<APPLE/kern/locks.h>

/*A Mach mutex is of type mutex_t. The functions that operate on mutexes include:
lck_mtx_t           *lck_mtx_alloc_init(lck_grp_t       *grp,
                                        lck_attr_t      *attr);
extern void         lck_mtx_init(       lck_mtx_t       *lck,
                                        lck_grp_t       *grp,
                                        lck_attr_t      *attr);
 
extern void         lck_mtx_lock(   lck_mtx_t           *lck);
 
extern void         lck_mtx_unlock( lck_mtx_t           *lck);
 
extern void         lck_mtx_destroy(lck_mtx_t           *lck,
                                    lck_grp_t           *grp);
 
extern void         lck_mtx_free(   lck_mtx_t           *lck,
                                    lck_grp_t           *grp);
 
extern wait_result_tlck_mtx_sleep(  lck_mtx_t           *lck,
                                    lck_sleep_action_t  lck_sleep_action,
                                    event_t             event,
                                    wait_interrupt_t    interruptible);
 
extern wait_result_tlck_mtx_sleep_deadline(
                                    lck_mtx_t           *lck,
                                    lck_sleep_action_t  lck_sleep_action,
                                    event_t             event,
                                    wait_interrupt_t    interruptible,
                                    uint64_t            deadline);
 
extern void         lck_mtx_assert( lck_mtx_t           *lck,
                                    unsigned int        type);*/
lck_mtx_t      *lck_mtx_alloc_init(lck_grp_t       *grp,
                                        lck_attr_t      *attr);
extern void         lck_mtx_init(       lck_mtx_t       *lck,
                                        lck_grp_t       *grp,
                                        lck_attr_t      *attr);
 
extern void         lck_mtx_lock(   lck_mtx_t           *lck);
 
extern void         lck_mtx_unlock( lck_mtx_t           *lck);
 
extern void         lck_mtx_destroy(lck_mtx_t           *lck,
                                    lck_grp_t           *grp);
 
extern void         lck_mtx_free(   lck_mtx_t           *lck,
                                    lck_grp_t           *grp);
 
extern wait_result_tlck_mtx_sleep(  lck_mtx_t           *lck,
                                    lck_sleep_action_t  lck_sleep_action,
                                    event_t             event,
                                    wait_interrupt_t    interruptible);
 
extern wait_result_tlck_mtx_sleep_deadline(
                                    lck_mtx_t           *lck,
                                    lck_sleep_action_t  lck_sleep_action,
                                    event_t             event,
                                    wait_interrupt_t    interruptible,
                                    uint64_t            deadline);
 
extern void         lck_mtx_assert( lck_mtx_t           *lck,
                                    unsigned int        type);
#endif 
