~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Merge refactored command line using for innodb

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2005 PrimeBase Technologies GmbH
 
1
/* Copyright (c) 2005 PrimeBase Technologies GmbH
2
2
 *
3
3
 * PrimeBase XT
4
4
 *
14
14
 *
15
15
 * You should have received a copy of the GNU General Public License
16
16
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
18
 *
19
19
 * 2008-01-24   Paul McCullagh
20
20
 *
326
326
 
327
327
typedef struct XTSpinXSLock {
328
328
        volatile xtWord2                        sxs_xlocked;
329
 
        volatile xtWord2                        sxs_xwaiter;
330
329
        volatile xtWord2                        sxs_rlock_count;
331
330
        volatile xtWord2                        sxs_wait_count;                 /* The number of readers waiting for the xlocker. */
332
331
#ifdef DEBUG
564
563
#define XT_HAVE_LOCK                    2
565
564
#define XT_WAITING                              3
566
565
 
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
 
 
620
566
#endif