summaryrefslogtreecommitdiff
path: root/include/my_global.h
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-08-16 16:31:16 -0700
committerunknown <jimw@mysql.com>2005-08-16 16:31:16 -0700
commitcbdd54e415c53e9fa7df8bd3b17b09612b8c0c5d (patch)
treeb0ab78c3fbc74eaeaaa0cab7e0659613c6a0195f /include/my_global.h
parent8fd77a045c3bf4f08e6c9e00f94692690d01b6f5 (diff)
downloadmariadb-git-cbdd54e415c53e9fa7df8bd3b17b09612b8c0c5d.tar.gz
Fix SLEEP() to be interruptable. (Bug #12582)
include/my_global.h: Add set_timespec_nsec() for setting higher-resolution time. sql/item_func.cc: Use pthread_cond_timedwait() for SLEEP() so that it can be killed using the normal thread/query-killing code.
Diffstat (limited to 'include/my_global.h')
-rw-r--r--include/my_global.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 95763f64e55..2627ea8e821 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -939,6 +939,13 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#endif /* HAVE_TIMESPEC_TS_SEC */
#endif /* set_timespec */
+#define set_timespec_nsec(ABSTIME,NSEC) \
+{\
+ ulonglong now= my_getsystime(); \
+ (ABSTIME).tv_sec= (now / ULL(10000000)) + (NSEC / ULL(1000000000)); \
+ (ABSTIME).tv_nsec= (now % ULL(10000000)) * 100 + (NSEC % ULL(1000000000)); \
+}
+
/*
Define-funktions for reading and storing in machine independent format
(low byte first)