~vkolesnikov/pbxt/pbxt-preload-test-bug

« back to all changes in this revision

Viewing changes to src/thread_xt.h

  • Committer: Vladimir Kolesnikov
  • Date: 2009-01-21 13:55:57 UTC
  • mto: This revision was merged to the branch mainline in revision 533.
  • Revision ID: vladimir@primebase.org-20090121135557-gyzk4wo3kj126jda
added thread lock lists

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include "xactlog_xt.h"
38
38
#include "datalog_xt.h"
39
39
#include "lock_xt.h"
 
40
#include "locklist_xt.h"
40
41
 
41
42
/*
42
43
 * -----------------------------------------------------------------------
118
119
#define XT_SOURCE_FILE_NAME_SIZE                40
119
120
#define XT_THR_NAME_SIZE                                80
120
121
 
 
122
#ifdef XT_THREAD_LOCK_INFO
 
123
#define xt_init_rwlock_with_autoname(a,b)       xt_init_rwlock(a,b,LOCKLIST_ARG_SUFFIX(b))
 
124
#else
 
125
#define xt_init_rwlock_with_autoname(a,b)       xt_init_rwlock(a,b)
 
126
#endif
 
127
 
121
128
typedef struct XTException {
122
129
        int                                             e_xt_err;                                                                       /* The XT error number (ALWAYS non-zero on error, else zero) */
123
130
        int                                             e_sys_err;                                                                      /* The system error number (0 if none) */
301
308
        xtBool                                  st_is_update;                                   /* TRUE if this is an UPDATE statement. */
302
309
        u_int                                   st_update_id;                                   /* The update statement ID. */
303
310
 
304
 
        XTRowLockListRec                st_lock_list;                                   /* The thread lock list (drop locks on transaction end). */
 
311
        XTRowLockListRec                st_lock_list;                                   /* The thread row lock list (drop locks on transaction end). */
305
312
        XTStatisticsRec                 st_statistics;                                  /* Accumulated statistics for this thread. */
 
313
#ifdef XT_THREAD_LOCK_INFO
 
314
        XTThreadLockInfoPtr             st_thread_lock_list;                    /* list of locks (spins, mutextes, etc) that this thread currently 
 
315
                                                                                                                           holds (debugging) */
 
316
#endif
306
317
} XTThreadRec, *XTThreadPtr;
307
318
 
308
319
/*
605
616
xtProcID                xt_getpid();
606
617
xtBool                  xt_process_exists(xtProcID pid);
607
618
 
608
 
xtBool                  xt_init_rwlock(XTThreadPtr self, xt_rwlock_type *rwlock);
 
619
#ifdef XT_THREAD_LOCK_INFO
 
620
xtBool xt_init_rwlock(XTThreadPtr self, xt_rwlock_type *rwlock, const char *name);
 
621
#else
 
622
xtBool xt_init_rwlock(XTThreadPtr self, xt_rwlock_type *rwlock);
 
623
#endif
 
624
 
609
625
void                    xt_free_rwlock(xt_rwlock_type *rwlock);
610
626
xt_rwlock_type  *xt_slock_rwlock(XTThreadPtr self, xt_rwlock_type *rwlock);
611
627
xt_rwlock_type  *xt_xlock_rwlock(XTThreadPtr self, xt_rwlock_type *rwlock);
613
629
 
614
630
xt_mutex_type   *xt_new_mutex(XTThreadPtr self);
615
631
void                    xt_delete_mutex(XTThreadPtr self, xt_mutex_type *mx);
 
632
#ifdef XT_THREAD_LOCK_INFO
 
633
#define                 xt_init_mutex_with_autoname(a,b) xt_init_mutex(a,b,LOCKLIST_ARG_SUFFIX(b))
 
634
xtBool                  xt_init_mutex(XTThreadPtr self, xt_mutex_type *mx, const char *name);
 
635
#else
 
636
#define                 xt_init_mutex_with_autoname(a,b) xt_init_mutex(a,b)
616
637
xtBool                  xt_init_mutex(XTThreadPtr self, xt_mutex_type *mx);
 
638
#endif
617
639
void                    xt_free_mutex(xt_mutex_type *mx);
618
640
xtBool                  xt_lock_mutex(XTThreadPtr self, xt_mutex_type *mx);
619
641
void                    xt_unlock_mutex(XTThreadPtr self, xt_mutex_type *mx);