563
564
#define XT_HAVE_LOCK 2
564
565
#define XT_WAITING 3
568
* -----------------------------------------------------------------------
569
* RECURSIVE MUTEX (allows lockers to lock again)
572
typedef struct XTRecursiveMutex {
573
struct XTThread *rm_locker;
575
xt_mutex_type rm_mutex;
577
#ifdef XT_THREAD_LOCK_INFO
578
XTThreadLockInfoRec rm_lock_info;
581
} XTRecursiveMutexRec, *XTRecursiveMutexPtr;
583
#ifdef XT_THREAD_LOCK_INFO
584
#define xt_recursivemutex_init_with_autoname(a,b) xt_recursivemutex_init(a,b,LOCKLIST_ARG_SUFFIX(b))
585
void xt_recursivemutex_init(struct XTThread *self, XTRecursiveMutexPtr rm, const char *name);
587
#define xt_recursivemutex_init_with_autoname(a,b) xt_recursivemutex_init(a,b)
588
void xt_recursivemutex_init(struct XTThread *self, XTRecursiveMutexPtr rm);
590
void xt_recursivemutex_free(XTRecursiveMutexPtr rm);
591
void xt_recursivemutex_lock(struct XTThread *self, XTRecursiveMutexPtr rm);
592
void xt_recursivemutex_unlock(struct XTThread *self, XTRecursiveMutexPtr rm);
594
typedef struct XTRecurRWLock {
595
struct XTThread *rrw_locker;
596
u_int rrw_lock_count;
597
xt_rwlock_type rrw_lock;
599
#ifdef XT_THREAD_LOCK_INFO
600
XTThreadLockInfoRec rrw_lock_info;
601
const char *rrw_name;
603
} XTRecurRWLockRec, *XTRecurRWLockPtr;
605
#ifdef XT_THREAD_LOCK_INFO
606
#define xt_recurrwlock_init_with_autoname(a,b) xt_recurrwlock_init(a,b,LOCKLIST_ARG_SUFFIX(b))
607
void xt_recurrwlock_init(struct XTThread *self, XTRecurRWLockPtr rrw, const char *name);
609
#define xt_recurrwlock_init_with_autoname(a,b) xt_recurrwlock_init(a,b)
610
void xt_recurrwlock_init(struct XTThread *self, XTRecurRWLockPtr rrw);
612
void xt_recurrwlock_free(XTRecurRWLockPtr rrw);
613
void xt_recurrwlock_xlock(struct XTThread *self, XTRecurRWLockPtr rrw);
614
void xt_recurrwlock_slock(struct XTThread *self, XTRecurRWLockPtr rrw);
615
void xt_recurrwlock_slock_ns(XTRecurRWLockPtr rrw);
616
void xt_recurrwlock_unxlock(struct XTThread *self, XTRecurRWLockPtr rrw);
617
void xt_recurrwlock_unslock(struct XTThread *self, XTRecurRWLockPtr rrw);
618
void xt_recurrwlock_unslock_ns(XTRecurRWLockPtr rrw);