CMGDK r49-rc2
组合类型 | 宏定义 | 类型定义 | 函数 | 变量
K:/CMGDKv18/SDK/Source/SQL/MySQL/include/my_pthread.h文件参考
#include <pthread.h>

浏览该文件的源代码。

组合类型

struct  st_safe_mutex_t
struct  st_safe_mutex_deadlock_t
struct  _my_rw_lock_t
struct  st_my_thread_var

宏定义

#define ETIME   ETIMEDOUT
#define EXTERNC
#define _REENTRANT
#define pthread_key(T, V)   pthread_key_t V
#define my_pthread_getspecific_ptr(T, V)   my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T, V)   pthread_setspecific(T,(void*) (V))
#define pthread_detach_this_thread()
#define pthread_handler_t   EXTERNC void *
#define my_sigwait(A, B)   sigwait((A),(B))
#define my_sigset(A, B)   signal((A),(B))
#define pthread_attr_setscope(A, B)
#define my_pthread_getspecific(A, B)   ((A) pthread_getspecific(B))
#define pthread_key_delete(A)   pthread_dummy(0)
#define HAVE_PTHREAD_KILL
#define set_timespec(ABSTIME, SEC)   set_timespec_nsec((ABSTIME),(SEC)*1000000000ULL)
#define set_timespec_nsec(ABSTIME, NSEC)   set_timespec_time_nsec((ABSTIME),my_getsystime(),(NSEC))
#define MY_tv_sec   tv_sec
#define MY_tv_nsec   tv_nsec
#define set_timespec_time_nsec(ABSTIME, TIME, NSEC)
#define MYF_TRY_LOCK   1
#define MYF_NO_DEADLOCK_DETECTION   2
#define my_pthread_mutex_init(A, B, C, D)   pthread_mutex_init((A),(B))
#define my_pthread_mutex_lock(A, B)   pthread_mutex_lock(A)
#define safe_mutex_assert_owner(mp)
#define safe_mutex_assert_not_owner(mp)
#define rw_lock_t   my_rw_lock_t
#define rw_rdlock(A)   my_rw_rdlock((A))
#define rw_wrlock(A)   my_rw_wrlock((A))
#define rw_tryrdlock(A)   my_rw_tryrdlock((A))
#define rw_trywrlock(A)   my_rw_trywrlock((A))
#define rw_unlock(A)   my_rw_unlock((A))
#define rwlock_destroy(A)   my_rwlock_destroy((A))
#define GETHOSTBYADDR_BUFF_SIZE   2048
#define thr_setconcurrency(A)   pthread_dummy(0)
#define pthread_attr_setstacksize(A, B)   pthread_dummy(0)
#define MY_MUTEX_INIT_SLOW   NULL
#define MY_MUTEX_INIT_FAST   NULL
#define MY_MUTEX_INIT_ERRCHK   NULL
#define ESRCH   1
#define THREAD_NAME_SIZE   10
#define DEFAULT_THREAD_STACK   (195*1024)
#define MY_PTHREAD_LOCK_READ   0
#define MY_PTHREAD_LOCK_WRITE   1
#define my_thread_var   (_my_thread_var())
#define my_errno   my_thread_var->thr_errno
#define THD_LIB_OTHER   1
#define THD_LIB_NPTL   2
#define THD_LIB_LT   4
#define statistic_decrement(V, L)   (V)--
#define statistic_increment(V, L)   (V)++
#define statistic_add(V, C, L)   (V)+=(C)
#define statistic_sub(V, C, L)   (V)-=(C)
#define status_var_increment(V)   (V)++
#define status_var_decrement(V)   (V)--
#define status_var_add(V, C)   (V)+=(C)
#define status_var_sub(V, C)   (V)-=(C)

类型定义

typedef void *(* pthread_handler )(void *)
typedef struct st_safe_mutex_t safe_mutex_t
typedef struct
st_safe_mutex_deadlock_t 
safe_mutex_deadlock_t
typedef struct _my_rw_lock_t my_rw_lock_t
typedef ulong my_thread_id

函数

int sigwait (sigset_t *setp, int *sigp)
struct tm * localtime_r (const time_t *clock, struct tm *res)
struct tm * gmtime_r (const time_t *clock, struct tm *res)
int safe_mutex_init (safe_mutex_t *mp, const pthread_mutexattr_t *attr, const char *name, myf my_flags, const char *file, uint line)
int safe_mutex_lock (safe_mutex_t *mp, myf my_flags, const char *file, uint line)
int safe_mutex_unlock (safe_mutex_t *mp, const char *file, uint line)
int safe_mutex_destroy (safe_mutex_t *mp, const char *file, uint line)
int safe_cond_wait (pthread_cond_t *cond, safe_mutex_t *mp, const char *file, uint line)
int safe_cond_timedwait (pthread_cond_t *cond, safe_mutex_t *mp, struct timespec *abstime, const char *file, uint line)
void safe_mutex_global_init (void)
void safe_mutex_end (FILE *file)
void safe_mutex_free_deadlock_data (safe_mutex_t *mp)
int my_rwlock_init (my_rw_lock_t *, void *)
int my_rwlock_destroy (my_rw_lock_t *)
int my_rw_rdlock (my_rw_lock_t *)
int my_rw_wrlock (my_rw_lock_t *)
int my_rw_unlock (my_rw_lock_t *)
int my_rw_tryrdlock (my_rw_lock_t *)
int my_rw_trywrlock (my_rw_lock_t *)
void my_threadattr_global_init (void)
my_bool my_thread_global_init (void)
void my_thread_global_end (void)
my_bool my_thread_init (void)
void my_thread_end (void)
const char * my_thread_name (void)
my_thread_id my_thread_dbug_id (void)
int pthread_dummy (int)
struct st_my_thread_var_my_thread_var (void) __attribute__((const ))
void ** my_thread_var_dbug ()
safe_mutex_t ** my_thread_var_mutex_in_use ()

变量

uint my_thread_end_wait_time
my_bool safe_mutex_deadlock_detector
uint thd_lib_detected

宏定义文档

#define _REENTRANT
#define DEFAULT_THREAD_STACK   (195*1024)
#define ESRCH   1
#define ETIME   ETIMEDOUT
#define EXTERNC
#define GETHOSTBYADDR_BUFF_SIZE   2048
#define HAVE_PTHREAD_KILL
#define my_errno   my_thread_var->thr_errno
#define MY_MUTEX_INIT_ERRCHK   NULL
#define MY_MUTEX_INIT_FAST   NULL
#define MY_MUTEX_INIT_SLOW   NULL
#define my_pthread_getspecific (   A,
 
)    ((A) pthread_getspecific(B))
#define my_pthread_getspecific_ptr (   T,
 
)    my_pthread_getspecific(T,(V))
#define MY_PTHREAD_LOCK_READ   0
#define MY_PTHREAD_LOCK_WRITE   1
#define my_pthread_mutex_init (   A,
  B,
  C,
 
)    pthread_mutex_init((A),(B))
#define my_pthread_mutex_lock (   A,
 
)    pthread_mutex_lock(A)
#define my_pthread_setspecific_ptr (   T,
 
)    pthread_setspecific(T,(void*) (V))
#define my_sigset (   A,
 
)    signal((A),(B))
#define my_sigwait (   A,
 
)    sigwait((A),(B))
#define my_thread_var   (_my_thread_var())
#define MY_tv_nsec   tv_nsec
#define MY_tv_sec   tv_sec
#define MYF_NO_DEADLOCK_DETECTION   2
#define MYF_TRY_LOCK   1
#define pthread_attr_setscope (   A,
 
)
#define pthread_attr_setstacksize (   A,
 
)    pthread_dummy(0)
#define pthread_detach_this_thread ( )
#define pthread_handler_t   EXTERNC void *
#define pthread_key (   T,
 
)    pthread_key_t V
#define pthread_key_delete (   A)    pthread_dummy(0)
#define rw_lock_t   my_rw_lock_t
#define rw_rdlock (   A)    my_rw_rdlock((A))
#define rw_tryrdlock (   A)    my_rw_tryrdlock((A))
#define rw_trywrlock (   A)    my_rw_trywrlock((A))
#define rw_unlock (   A)    my_rw_unlock((A))
#define rw_wrlock (   A)    my_rw_wrlock((A))
#define rwlock_destroy (   A)    my_rwlock_destroy((A))
#define safe_mutex_assert_not_owner (   mp)
#define safe_mutex_assert_owner (   mp)
#define set_timespec (   ABSTIME,
  SEC 
)    set_timespec_nsec((ABSTIME),(SEC)*1000000000ULL)
#define set_timespec_nsec (   ABSTIME,
  NSEC 
)    set_timespec_time_nsec((ABSTIME),my_getsystime(),(NSEC))
#define set_timespec_time_nsec (   ABSTIME,
  TIME,
  NSEC 
)
值:
do {                  \
  ulonglong nsec= (NSEC);                                               \
  ulonglong now= (TIME) + (nsec/100);                                   \
  (ABSTIME).MY_tv_sec=  (now / 10000000ULL);                          \
  (ABSTIME).MY_tv_nsec= (now % 10000000ULL * 100 + (nsec % 100));     \
} while(0)
#define statistic_add (   V,
  C,
 
)    (V)+=(C)
#define statistic_decrement (   V,
 
)    (V)--
#define statistic_increment (   V,
 
)    (V)++
#define statistic_sub (   V,
  C,
 
)    (V)-=(C)
#define status_var_add (   V,
 
)    (V)+=(C)
#define status_var_decrement (   V)    (V)--
#define status_var_increment (   V)    (V)++
#define status_var_sub (   V,
 
)    (V)-=(C)
#define THD_LIB_LT   4
#define THD_LIB_NPTL   2
#define THD_LIB_OTHER   1
#define thr_setconcurrency (   A)    pthread_dummy(0)
#define THREAD_NAME_SIZE   10

类型定义文档

typedef struct _my_rw_lock_t my_rw_lock_t
typedef void*(* pthread_handler)(void *)
typedef struct st_safe_mutex_t safe_mutex_t

函数文档

struct st_my_thread_var* _my_thread_var ( void  ) const [read]
struct tm* gmtime_r ( const time_t *  clock,
struct tm *  res 
) [read]
struct tm* localtime_r ( const time_t *  clock,
struct tm *  res 
) [read]
int my_rw_rdlock ( my_rw_lock_t )
int my_rw_tryrdlock ( my_rw_lock_t )
int my_rw_trywrlock ( my_rw_lock_t )
int my_rw_unlock ( my_rw_lock_t )
int my_rw_wrlock ( my_rw_lock_t )
int my_rwlock_destroy ( my_rw_lock_t )
int my_rwlock_init ( my_rw_lock_t ,
void *   
)
my_thread_id my_thread_dbug_id ( void  )
void my_thread_end ( void  )
void my_thread_global_end ( void  )
my_bool my_thread_global_init ( void  )
my_bool my_thread_init ( void  )
const char* my_thread_name ( void  )
void** my_thread_var_dbug ( )
safe_mutex_t** my_thread_var_mutex_in_use ( )
void my_threadattr_global_init ( void  )
int pthread_dummy ( int  )
int safe_cond_timedwait ( pthread_cond_t *  cond,
safe_mutex_t mp,
struct timespec *  abstime,
const char *  file,
uint  line 
)
int safe_cond_wait ( pthread_cond_t *  cond,
safe_mutex_t mp,
const char *  file,
uint  line 
)
int safe_mutex_destroy ( safe_mutex_t mp,
const char *  file,
uint  line 
)
void safe_mutex_end ( FILE *  file)
void safe_mutex_free_deadlock_data ( safe_mutex_t mp)
void safe_mutex_global_init ( void  )
int safe_mutex_init ( safe_mutex_t mp,
const pthread_mutexattr_t *  attr,
const char *  name,
myf  my_flags,
const char *  file,
uint  line 
)
int safe_mutex_lock ( safe_mutex_t mp,
myf  my_flags,
const char *  file,
uint  line 
)
int safe_mutex_unlock ( safe_mutex_t mp,
const char *  file,
uint  line 
)
int sigwait ( sigset_t setp,
int *  sigp 
)

变量文档

 全部  名字空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义