~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbxt/src/lock_xt.h

  • Committer: lbieber
  • Date: 2010-09-22 13:48:54 UTC
  • mfrom: (1784.1.3 build)
  • Revision ID: lbieber@orisndriz08-20100922134854-y7mae2taqhn73vsx
Merge Paul M. - latest changes from PBXT 1.0.11-7
Merge Paul M. - fix bug 641038 - pbxt rollback not working (tables reported as non-transactional)
Merge Andrew - fix show stoppers for new drizzledump

Show diffs side-by-side

added added

removed removed

Lines of Context:
326
326
 
327
327
typedef struct XTSpinXSLock {
328
328
        volatile xtWord2                        sxs_xlocked;
 
329
        volatile xtWord2                        sxs_xwaiter;
329
330
        volatile xtWord2                        sxs_rlock_count;
330
331
        volatile xtWord2                        sxs_wait_count;                 /* The number of readers waiting for the xlocker. */
331
332
#ifdef DEBUG
563
564
#define XT_HAVE_LOCK                    2
564
565
#define XT_WAITING                              3
565
566
 
 
567
/*
 
568
 * -----------------------------------------------------------------------
 
569
 * RECURSIVE MUTEX (allows lockers to lock again)
 
570
 */
 
571
 
 
572
typedef struct XTRecursiveMutex {
 
573
        struct XTThread                         *rm_locker;
 
574
        u_int                                           rm_lock_count;
 
575
        xt_mutex_type                           rm_mutex;
 
576
 
 
577
#ifdef XT_THREAD_LOCK_INFO
 
578
        XTThreadLockInfoRec                     rm_lock_info;
 
579
        const char                                  *rm_name;
 
580
#endif
 
581
} XTRecursiveMutexRec, *XTRecursiveMutexPtr;
 
582
 
 
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);
 
586
#else
 
587
#define xt_recursivemutex_init_with_autoname(a,b) xt_recursivemutex_init(a,b)
 
588
void xt_recursivemutex_init(struct XTThread *self, XTRecursiveMutexPtr rm);
 
589
#endif
 
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);
 
593
 
 
594
typedef struct XTRecurRWLock {
 
595
        struct XTThread                         *rrw_locker;
 
596
        u_int                                           rrw_lock_count;
 
597
        xt_rwlock_type                          rrw_lock;
 
598
 
 
599
#ifdef XT_THREAD_LOCK_INFO
 
600
        XTThreadLockInfoRec                     rrw_lock_info;
 
601
        const char                                  *rrw_name;
 
602
#endif
 
603
} XTRecurRWLockRec, *XTRecurRWLockPtr;
 
604
 
 
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);
 
608
#else
 
609
#define xt_recurrwlock_init_with_autoname(a,b) xt_recurrwlock_init(a,b)
 
610
void xt_recurrwlock_init(struct XTThread *self, XTRecurRWLockPtr rrw);
 
611
#endif
 
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);
 
619
 
566
620
#endif