mariadb/include
Dmitry Lenev 6b5c4a9ef6 Fix for bug #51105 "MDL deadlock in rqg_mdl_stability test
on Windows".

On platforms where read-write lock implementation does not
prefer readers by default (Windows, Solaris) server might
have deadlocked while detecting MDL deadlock.

MDL deadlock detector relies on the fact that read-write
locks which are used in its implementation prefer readers
(see new comment for MDL_lock::m_rwlock for details).
So far MDL code assumed that default implementation of
read/write locks for the system has this property.
Indeed, this turned out ot be wrong, for example, for
Windows or Solaris. Thus MDL deadlock detector might have
deadlocked on these systems.

This fix simply adds portable implementation of read/write
lock which prefer readers and changes MDL code to use this
new type of synchronization primitive.

No test case is added as existing rqg_mdl_stability test can
serve as one.

config.h.cmake:
  Check for presence of pthread_rwlockattr_setkind_np to be
  able to determine if system natively supports read-write
  locks for which we can specify if readers or writers should
  be preferred.
configure.cmake:
  Check for presence of pthread_rwlockattr_setkind_np to be
  able to determine if system natively supports read-write
  locks for which we can specify if readers or writers should
  be preferred.
configure.in:
  Check for presence of pthread_rwlockattr_setkind_np to be
  able to determine if system natively supports read-write
  locks for which we can specify if readers or writers should
  be preferred.
include/my_pthread.h:
  Added support for portable read-write locks which prefer
  readers.
  To do so extended existing my_rw_lock_t implementation to
  support selection of whom to prefer depending on a flag.
mysys/thr_rwlock.c:
  Extended existing my_rw_lock_t implementation to support
  selection of whom to prefer depending on a flag.
  Added rw_pr_init() function implementing initialization of
  read-write locks preferring readers.
sql/mdl.cc:
  Use portable read-write locks which prefer readers instead of
  relying on that system implementation of read-write locks has
  this property (this was true for Linux/NPTL but was false,
  for example, for Windows and Solaris).
  Added comment explaining why preferring readers is important
  for MDL deadlock detector (thanks to Serg for example!).
sql/mdl.h:
  Use portable read-write locks which prefer readers instead of
  relying on that system implementation of read-write locks has
  this property (this was true for Linux/NPTL but was false,
  for example, for Windows and Solaris).
2010-02-28 07:35:09 +03:00
..
atomic Fix compiler warnings in my_atomic.h 2010-02-19 17:20:29 +03:00
mysql merge 2010-02-13 17:01:32 +01:00
base64.h Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
CMakeLists.txt merge, add plugin/audit_null/CMakeLists.txt 2010-01-26 05:39:48 +01:00
config-netware.h WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
config-win.h Manual merge from mysql-next-mr. 2010-01-18 23:19:19 +03:00
decimal.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
errmsg.h Merge from mysql-next-mr. 2009-10-28 10:55:44 +03:00
ft_global.h WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
hash.h WL#5137, Remove hash calculation from LOCK_open in open_table 2009-11-20 19:27:54 +01:00
heap.h WL#2360 Performance schema 2009-12-04 18:26:15 -07:00
help_end.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
help_start.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
keycache.h merge 2009-12-25 16:49:21 +01:00
lf.h WL#3230 concurrent hash 2009-11-17 19:31:40 -07:00
m_ctype.h Post-fix for WL#3090. 2010-02-16 13:16:12 +04:00
m_string.h Manual merge from mysql-trunk-merge. 2010-01-19 19:36:14 +03:00
Makefile.am merge, add plugin/audit_null/CMakeLists.txt 2010-01-26 05:39:48 +01:00
my_aes.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_alarm.h Backport of: 2009-11-24 16:54:59 +03:00
my_alloc.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_atomic.h Auto-merge from mysql-next-mr-bugfixing. 2010-02-23 18:49:21 +03:00
my_attribute.h Bug#25118 ATTRIBUTE_FORMAT_FPTR undeclared in m_ctype.h 2007-04-12 00:43:25 +02:00
my_base.h Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
my_bit.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_bitmap.h WL#2360 Performance schema 2009-12-09 20:19:51 -07:00
my_dbug.h merging 5.1 main -> rpl+2. Some manual work required mostly due to bug46640 2009-11-06 18:35:04 +02:00
my_dir.h This is the downport of 2009-09-11 22:26:35 +02:00
my_getopt.h WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
my_global.h Bug#41103 6.0 Windows embedded-server tests fail 2010-02-25 16:23:43 +04:00
my_handler.h Backporting WL#4164 Two-byte collation IDs 2009-10-15 15:17:32 +05:00
my_libwrap.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_list.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_md5.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_net.h Backport of WL#798 (MySQL IPv6 support) from 6.0. 2009-11-25 13:53:23 +03:00
my_no_pthread.h Manual merge from mysql-trunk-merge. 2009-12-16 21:02:21 +03:00
my_nosys.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_pthread.h Fix for bug #51105 "MDL deadlock in rqg_mdl_stability test 2010-02-28 07:35:09 +03:00
my_rdtsc.h WL#2373 Use cycle counter for timing 2009-11-24 16:36:31 -07:00
my_stacktrace.h Merging from 5.0-bugteam 2010-01-27 11:42:20 +01:00
my_sys.h merge 2010-02-16 23:19:47 +01:00
my_time.h WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
my_tree.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_trie.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_uctype.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_user.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_vle.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_xml.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
myisam.h WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
myisammrg.h WL#2360 Performance schema 2009-12-04 18:26:15 -07:00
myisampack.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
mysql.h Manual merge from mysql-trunk. 2009-12-11 12:39:38 +03:00
mysql.h.pp WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
mysql_com.h Patch for WL#3736: Extended Table, Column and Index Comments. 2010-02-20 13:07:32 +03:00
mysql_embed.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
mysql_time.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
mysql_version.h.in Bug #15327: configure: --with-tcp-port option being partially ignored 2007-09-13 16:19:46 +02:00
mysys_err.h WL#2936 2007-03-02 08:43:45 -08:00
probes_mysql.d.base Fixing some issues in the build when using DTrace probes 2009-03-18 10:04:15 +00:00
probes_mysql.h Backport of DTrace patches from 6.0 2008-12-20 11:01:41 +01:00
probes_mysql_nodtrace.h Re-adding 'include/probes_mysql_nodtrace.h' removed by accident 2010-02-17 14:37:55 +03:00
queues.h Bug #31890 Partitions: ORDER BY DESC in InnoDB not working. 2007-11-14 22:20:31 +04:00
rijndael.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
service_versions.h WL#4903 Plugin Service API part I 2009-11-02 21:05:42 +01:00
sha1.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
sql_common.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
sslopt-case.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
sslopt-longopts.h WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
sslopt-vars.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
t_ctype.h Many files: 2006-12-23 20:17:15 +01:00
thr_alarm.h WL#5161 : Cross-platform build with CMake 2009-11-09 12:32:48 +01:00
thr_lock.h Followup to Bug#45225 Locking: hang if drop table with no timeout 2010-02-15 13:11:20 +01:00
typelib.h WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
violite.h Manual merge from mysql-trunk-merge. 2009-12-12 23:38:59 +03:00