summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2010-02-16 23:19:47 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2010-02-16 23:19:47 +0100
commit5b77604cc2d76bf78af113096001c21067970841 (patch)
treebb2aacb96d3588f443a65da32dbfa2b6508efb80 /include
parent14e563ce5f05498d0a4a9aabd73e02690d093cb0 (diff)
parentab293e26c385d3dfc1b51923b50fd5f2ac158ee0 (diff)
downloadmariadb-git-5b77604cc2d76bf78af113096001c21067970841.tar.gz
merge
Diffstat (limited to 'include')
-rw-r--r--include/my_base.h5
-rw-r--r--include/my_global.h21
-rw-r--r--include/my_pthread.h40
-rw-r--r--include/my_sys.h3
-rw-r--r--include/thr_lock.h15
5 files changed, 76 insertions, 8 deletions
diff --git a/include/my_base.h b/include/my_base.h
index 226a6c44733..b9d0bb48480 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -191,10 +191,11 @@ enum ha_extra_function {
/* Inform handler that we will do a rename */
HA_EXTRA_PREPARE_FOR_RENAME,
/*
- Orders MERGE handler to attach or detach its child tables. Used at
- begin and end of a statement.
+ Special actions for MERGE tables.
*/
+ HA_EXTRA_ADD_CHILDREN_LIST,
HA_EXTRA_ATTACH_CHILDREN,
+ HA_EXTRA_IS_ATTACHED_CHILDREN,
HA_EXTRA_DETACH_CHILDREN
};
diff --git a/include/my_global.h b/include/my_global.h
index d71ab89e008..dc28682f1f1 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1681,7 +1681,7 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
#if !defined(max)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
+#endif
/*
Only Linux is known to need an explicit sync of the directory to make sure a
file creation/deletion/renaming in(from,to) this directory durable.
@@ -1694,6 +1694,25 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
#define bool In_C_you_should_use_my_bool_instead()
#endif
+/* Provide __func__ macro definition for platforms that miss it. */
+#if __STDC_VERSION__ < 199901L
+# if __GNUC__ >= 2
+# define __func__ __FUNCTION__
+# else
+# define __func__ "<unknown>"
+# endif
+#elif defined(_MSC_VER)
+# if _MSC_VER < 1300
+# define __func__ "<unknown>"
+# else
+# define __func__ __FUNCTION__
+# endif
+#elif defined(__BORLANDC__)
+# define __func__ __FUNC__
+#else
+# define __func__ "<unknown>"
+#endif
+
#ifndef HAVE_RINT
/**
All integers up to this number can be represented exactly as double precision
diff --git a/include/my_pthread.h b/include/my_pthread.h
index f2df7f4c198..0e421f678b0 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -102,6 +102,19 @@ struct timespec {
(ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
}
+/**
+ Compare two timespec structs.
+
+ @retval 1 If TS1 ends after TS2.
+
+ @retval 0 If TS1 is equal to TS2.
+
+ @retval -1 If TS1 ends before TS2.
+*/
+#define cmp_timespec(TS1, TS2) \
+ ((TS1.tv.i64 > TS2.tv.i64) ? 1 : \
+ ((TS1.tv.i64 < TS2.tv.i64) ? -1 : 0))
+
int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *);
@@ -417,6 +430,33 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif /* !set_timespec_nsec */
#endif /* HAVE_TIMESPEC_TS_SEC */
+/**
+ Compare two timespec structs.
+
+ @retval 1 If TS1 ends after TS2.
+
+ @retval 0 If TS1 is equal to TS2.
+
+ @retval -1 If TS1 ends before TS2.
+*/
+#ifdef HAVE_TIMESPEC_TS_SEC
+#ifndef cmp_timespec
+#define cmp_timespec(TS1, TS2) \
+ ((TS1.ts_sec > TS2.ts_sec || \
+ (TS1.ts_sec == TS2.ts_sec && TS1.ts_nsec > TS2.ts_nsec)) ? 1 : \
+ ((TS1.ts_sec < TS2.ts_sec || \
+ (TS1.ts_sec == TS2.ts_sec && TS1.ts_nsec < TS2.ts_nsec)) ? -1 : 0))
+#endif /* !cmp_timespec */
+#else
+#ifndef cmp_timespec
+#define cmp_timespec(TS1, TS2) \
+ ((TS1.tv_sec > TS2.tv_sec || \
+ (TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec > TS2.tv_nsec)) ? 1 : \
+ ((TS1.tv_sec < TS2.tv_sec || \
+ (TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec < TS2.tv_nsec)) ? -1 : 0))
+#endif /* !cmp_timespec */
+#endif /* HAVE_TIMESPEC_TS_SEC */
+
/* safe_mutex adds checking to mutex for easier debugging */
#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY)
diff --git a/include/my_sys.h b/include/my_sys.h
index 645463714d1..a3665d43b50 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -238,6 +238,9 @@ extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
extern uint my_file_limit;
extern ulong my_thread_stack_size;
+extern const char *(*proc_info_hook)(void *, const char *, const char *,
+ const char *, const unsigned int);
+
#ifdef HAVE_LARGE_PAGES
extern my_bool my_use_large_pages;
extern uint my_large_page_size;
diff --git a/include/thr_lock.h b/include/thr_lock.h
index d669d2dd2ab..1f4072ca0c5 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -83,7 +83,6 @@ enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1,
extern ulong max_write_lock_count;
-extern ulong table_lock_wait_timeout;
extern my_bool thr_lock_inited;
extern enum thr_lock_type thr_upgraded_concurrent_insert_lock;
@@ -156,19 +155,25 @@ void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data,
void *status_param);
enum enum_thr_lock_result thr_lock(THR_LOCK_DATA *data,
THR_LOCK_OWNER *owner,
- enum thr_lock_type lock_type);
+ enum thr_lock_type lock_type,
+ ulong lock_wait_timeout);
void thr_unlock(THR_LOCK_DATA *data);
enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data,
- uint count, THR_LOCK_OWNER *owner);
+ uint count, THR_LOCK_OWNER *owner,
+ ulong lock_wait_timeout);
void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
+void
+thr_lock_merge_status(THR_LOCK_DATA **data, uint count);
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
void thr_print_locks(void); /* For debugging */
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data,
- enum thr_lock_type new_lock_type);
+ enum thr_lock_type new_lock_type,
+ ulong lock_wait_timeout);
void thr_downgrade_write_lock(THR_LOCK_DATA *data,
enum thr_lock_type new_lock_type);
-my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data);
+my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data,
+ ulong lock_wait_timeout);
#ifdef __cplusplus
}
#endif