]>
git.saurik.com Git - apple/hfs.git/blob - livefiles_hfs_plugin/lf_hfs_locks.h
1 /* Copyright © 2017-2018 Apple Inc. All rights reserved.
6 * Created by Or Haimovich on 18/3/18.
10 #define lf_hfs_locks_h
24 typedef uint8_t lck_attr_t
;
25 typedef uint8_t lck_grp_attr_t
;
26 typedef uint8_t lck_grp_t
;
29 void lf_lck_rw_init ( pthread_rwlock_t
* lck
);
30 void lf_lck_rw_destroy ( pthread_rwlock_t
* lck
);
31 void lf_lck_rw_unlock_shared ( pthread_rwlock_t
* lck
);
32 void lf_lck_rw_lock_shared ( pthread_rwlock_t
* lck
);
33 void lf_lck_rw_lock_exclusive ( pthread_rwlock_t
* lck
);
34 void lf_lck_rw_unlock_exclusive ( pthread_rwlock_t
* lck
);
35 bool lf_lck_rw_try_lock ( pthread_rwlock_t
* lck
, lck_rwlock_type_e which
);
36 void lf_lck_rw_lock_exclusive_to_shared ( pthread_rwlock_t
* lck
);
37 bool lf_lck_rw_lock_shared_to_exclusive ( pthread_rwlock_t
* lck
);
40 void lf_lck_mtx_init ( pthread_mutex_t
* lck
);
41 void lf_lck_mtx_destroy ( pthread_mutex_t
*lck
);
42 void lf_lck_mtx_lock ( pthread_mutex_t
* lck
);
43 void lf_lck_mtx_unlock ( pthread_mutex_t
* lck
);
44 void lf_lck_mtx_lock_spin ( pthread_mutex_t
*lck
);
45 int lf_lck_mtx_try_lock ( pthread_mutex_t
*lck
);
46 void lf_lck_mtx_convert_spin ( pthread_mutex_t
*lck
);
49 void lf_cond_destroy( pthread_cond_t
* cond
);
50 void lf_cond_init( pthread_cond_t
* cond
);
51 int lf_cond_wait_relative(pthread_cond_t
*pCond
, pthread_mutex_t
*pMutex
, struct timespec
*pTime
);
52 void lf_cond_wakeup(pthread_cond_t
*pCond
);
55 void lf_lck_spin_init ( pthread_mutex_t
*lck
);
56 void lf_lck_spin_destroy ( pthread_mutex_t
*lck
);
57 void lf_lck_spin_lock ( pthread_mutex_t
*lck
);
58 void lf_lck_spin_unlock ( pthread_mutex_t
*lck
);
61 lck_attr_t
*lf_lck_attr_alloc_init ( void );
62 lck_grp_attr_t
*lf_lck_grp_attr_alloc_init ( void );
63 lck_grp_t
*lf_lck_grp_alloc_init ( void );
65 #endif /* lf_hfs_locks_h */