mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Small bug fixes + code for DELETE QUICK
Docs/manual.texi: Change log + bug fixes from the mailing list configure.in: added mlockall include/config-win.h: Fix to use SAFE_MUTEX include/ft_global.h: Free memory include/my_pthread.h: Fix for SAFE_MUTEX on windows myisam/Makefile.am: Fix modes myisam/ft_static.c: Fix language problem with fulltext myisam/ft_stopwords.c: Free memory at end myisam/mi_create.c: Fix language problem with fulltext myisam/mi_delete.c: Added optimization to not join blocks when using delete with QUICK myisam/mi_panic.c: Added freeing of memorty myisam/mi_test2.c: Added quick mode myisam/myisamchk.c: Fixed help text myisam/myisamdef.h: Added optimization to not join blocks when using delete with QUICK mysys/mf_format.c: Don't change case for extension mysys/my_wincond.c: Fix for safe mutex mysys/thr_mutex.c: Fix for safe mutex sql-bench/test-insert.sh: Split delete test to get more information about the times sql/ChangeLog: Changelog sql/ha_myisam.cc: Better OPTIMIZE handling sql/log.cc: Cleanup sql/mysql_priv.h: Fix for safe mutex sql/mysqld.cc: Added define for --one-thread option sql/sql_class.h: Fixed lock_time in slow_log sql/sql_delete.cc: Fix for safe mutex sql/sql_parse.cc: Fix processlist message for new process sql/sql_table.cc: Fix windows problem med CREATE INDEX sql/sql_yacc.yy: Fix for safe mutex sql/table.cc: Made code simpler strings/bmove512.c: Small speed fix support-files/mysql.server.sh: Fixed awk usage
This commit is contained in:
@ -55,6 +55,7 @@ struct timespec { /* For pthread_cond_timedwait() */
|
||||
long tv_nsec;
|
||||
};
|
||||
|
||||
typedef int pthread_mutexattr_t;
|
||||
#define win_pthread_self my_thread_var->pthread_self
|
||||
#define pthread_handler_decl(A,B) unsigned __cdecl A(void *B)
|
||||
typedef unsigned (__cdecl *pthread_handler)(void *);
|
||||
@ -215,42 +216,6 @@ extern int my_pthread_getprio(pthread_t thread_id);
|
||||
#define pthread_handler_decl(A,B) void *A(void *B)
|
||||
typedef void *(* pthread_handler)(void *);
|
||||
|
||||
/* safe mutex for debugging */
|
||||
|
||||
typedef struct st_safe_mutex_t
|
||||
{
|
||||
pthread_mutex_t global,mutex;
|
||||
char *file;
|
||||
uint line,count;
|
||||
pthread_t thread;
|
||||
} safe_mutex_t;
|
||||
|
||||
int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr);
|
||||
int safe_mutex_lock(safe_mutex_t *mp,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);
|
||||
|
||||
#ifdef SAFE_MUTEX
|
||||
#undef pthread_mutex_init
|
||||
#undef pthread_mutex_lock
|
||||
#undef pthread_mutex_unlock
|
||||
#undef pthread_mutex_destroy
|
||||
#undef pthread_mutex_wait
|
||||
#undef pthread_mutex_timedwait
|
||||
#undef pthread_mutex_t
|
||||
#define pthread_mutex_init(A,B) safe_mutex_init((A),(B))
|
||||
#define pthread_mutex_lock(A) safe_mutex_lock((A),__FILE__,__LINE__)
|
||||
#define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__)
|
||||
#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__)
|
||||
#define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__)
|
||||
#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
|
||||
#define pthread_mutex_t safe_mutex_t
|
||||
#endif
|
||||
|
||||
/* Test first for RTS or FSU threads */
|
||||
|
||||
#if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM)
|
||||
@ -424,7 +389,44 @@ struct hostent *my_gethostbyname_r(const char *name,
|
||||
|
||||
#endif /* defined(__WIN__) */
|
||||
|
||||
/* READ-WRITE thread locking */
|
||||
/* safe_mutex adds checking to mutex for easier debugging */
|
||||
|
||||
typedef struct st_safe_mutex_t
|
||||
{
|
||||
pthread_mutex_t global,mutex;
|
||||
char *file;
|
||||
uint line,count;
|
||||
pthread_t thread;
|
||||
} safe_mutex_t;
|
||||
|
||||
int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr);
|
||||
int safe_mutex_lock(safe_mutex_t *mp,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);
|
||||
|
||||
/* Wrappers if safe mutex is actually used */
|
||||
#ifdef SAFE_MUTEX
|
||||
#undef pthread_mutex_init
|
||||
#undef pthread_mutex_lock
|
||||
#undef pthread_mutex_unlock
|
||||
#undef pthread_mutex_destroy
|
||||
#undef pthread_mutex_wait
|
||||
#undef pthread_mutex_timedwait
|
||||
#undef pthread_mutex_t
|
||||
#define pthread_mutex_init(A,B) safe_mutex_init((A),(B))
|
||||
#define pthread_mutex_lock(A) safe_mutex_lock((A),__FILE__,__LINE__)
|
||||
#define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__)
|
||||
#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__)
|
||||
#define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__)
|
||||
#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
|
||||
#define pthread_mutex_t safe_mutex_t
|
||||
#endif /* SAFE_MUTEX */
|
||||
|
||||
/* READ-WRITE thread locking */
|
||||
|
||||
#if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS)
|
||||
/* use these defs for simple mutex locking */
|
||||
|
Reference in New Issue
Block a user