summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-09-20 04:54:10 +0300
committerunknown <monty@donna.mysql.com>2000-09-20 04:54:10 +0300
commit5a2419eb89d2f617e94ebef64ffbef72417ec94c (patch)
tree9809b1ec91af01ed8cc76e542fe1a102e239d9b1 /include
parent5a4aa474d879ac9598941665bef6f0938efc91e1 (diff)
downloadmariadb-git-5a2419eb89d2f617e94ebef64ffbef72417ec94c.tar.gz
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
Diffstat (limited to 'include')
-rw-r--r--include/config-win.h1
-rw-r--r--include/ft_global.h1
-rw-r--r--include/my_pthread.h76
3 files changed, 41 insertions, 37 deletions
diff --git a/include/config-win.h b/include/config-win.h
index a0008675d49..4dc3ecd74e2 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -290,6 +290,7 @@ inline double ulonglong2double(ulonglong value)
#define MY_NFILE 127 /* This is only used to save filenames */
+#define DO_NOT_REMOVE_THREAD_WRAPPERS
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
/* The following is only used for statistics, so it should be good enough */
#ifdef __NT__ /* This should also work on Win98 but .. */
diff --git a/include/ft_global.h b/include/ft_global.h
index 32490dd079f..90641313235 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -43,6 +43,7 @@ typedef struct st_ft_doclist {
extern const char *ft_precompiled_stopwords[];
int ft_init_stopwords(const char **);
+void ft_free_stopwords(void);
FT_DOCLIST * ft_init_search(void *, uint, byte *, uint, my_bool);
int ft_read_next(FT_DOCLIST *, char *);
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 4adcc958590..d5f3fa735b2 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -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 */