List:Internals« Previous MessageNext Message »
From:msvensson Date:April 27 2005 9:59am
Subject:bk commit into 4.1 tree (msvensson:1.2207) BUG#9954
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2207 05/04/27 09:59:12 msvensson@neptunus.(none) +4 -0
  Bug #9954 mysql-4.1.11/cmd-line-utils/libedit/makelist.sh is not portable
    - Changed makelist.sh
    - Bump up required version of autoconf
    - Use new style to init mutex in my_thr_init

  mysys/my_thr_init.c
    1.29 05/04/27 09:59:09 msvensson@neptunus.(none) +12 -16
    Use new style functions to init mutex if PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP is
defined
    Add comment what mutex "kind" means

  include/my_pthread.h
    1.78 05/04/27 09:59:09 msvensson@neptunus.(none) +3 -9
    Use PTHREAD_MUTEX_ADAPTIVE_NP to see if "fast" mutexes are available
    Remove "errorcheck" mutexes, since they are never used.

  configure.in
    1.362 05/04/27 09:59:09 msvensson@neptunus.(none) +1 -1
    Bump up required AC version number so that correct version of aclocal and autoconf is
selected.

  cmd-line-utils/libedit/makelist.sh
    1.7 05/04/27 09:59:09 msvensson@neptunus.(none) +4 -3
    Changed file so it works also on windows cr/lf files.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/bug9954

--- 1.361/configure.in	2005-04-13 19:05:00 +02:00
+++ 1.362/configure.in	2005-04-27 09:59:09 +02:00
@@ -118,7 +118,7 @@
 AC_SUBST(SAVE_CXXLDFLAGS)
 AC_SUBST(CXXLDFLAGS)
 
-AC_PREREQ(2.12)dnl		Minimum Autoconf version required.
+AC_PREREQ(2.58)dnl		Minimum Autoconf version required.
 
 #AC_ARG_PROGRAM			# Automaticly invoked by AM_INIT_AUTOMAKE
 AM_SANITY_CHECK

--- 1.77/include/my_pthread.h	2005-02-10 16:56:23 +01:00
+++ 1.78/include/my_pthread.h	2005-04-27 09:59:09 +02:00
@@ -604,19 +604,13 @@
 #define pthread_attr_setstacksize(A,B) pthread_dummy(0)
 #endif
 
-/* Define mutex types */
+/* Define mutex types, see my_thr_init.c */
 #define MY_MUTEX_INIT_SLOW   NULL
-#define MY_MUTEX_INIT_FAST   NULL
-#define MY_MUTEX_INIT_ERRCHK NULL
 #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
 extern pthread_mutexattr_t my_fast_mutexattr;
-#undef  MY_MUTEX_INIT_FAST
 #define MY_MUTEX_INIT_FAST &my_fast_mutexattr
-#endif
-#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
-extern pthread_mutexattr_t my_errchk_mutexattr;
-#undef MY_INIT_MUTEX_ERRCHK
-#define MY_INIT_MUTEX_ERRCHK &my_errchk_mutexattr
+#else
+#define MY_MUTEX_INIT_FAST   NULL
 #endif
 
 extern my_bool my_thread_global_init(void);

--- 1.28/mysys/my_thr_init.c	2004-10-22 17:44:48 +02:00
+++ 1.29/mysys/my_thr_init.c	2005-04-27 09:59:09 +02:00
@@ -40,9 +40,6 @@
 #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
 pthread_mutexattr_t my_fast_mutexattr;
 #endif
-#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
-pthread_mutexattr_t my_errchk_mutexattr;
-#endif
 
 /*
   initialize thread environment
@@ -62,19 +59,21 @@
     fprintf(stderr,"Can't initialize threads: error %d\n",errno);
     return 1;
   }
+
 #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
-  pthread_mutexattr_init(&my_fast_mutexattr);
   /*
-    Note that the following statement may give a compiler warning under
-    some configurations, but there isn't anything we can do about this as
-    this is a bug in the header files for the thread implementation
+    Set mutex type to "fast" a.k.a "adaptive"
+
+    The mutex kind determines what happens if a thread attempts to lock
+    a mutex it already owns with pthread_mutex_lock(3). If the mutex
+    is of the ``fast'' kind, pthread_mutex_lock(3) simply suspends
+    the calling thread forever. If the mutex is of the ``error checking''
+    kind, pthread_mutex_lock(3) returns immediately with the error
+    code EDEADLK.
   */
-  pthread_mutexattr_setkind_np(&my_fast_mutexattr,PTHREAD_MUTEX_ADAPTIVE_NP);
-#endif
-#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
-  pthread_mutexattr_init(&my_errchk_mutexattr);
-  pthread_mutexattr_setkind_np(&my_errchk_mutexattr,
-			       PTHREAD_MUTEX_ERRORCHECK_NP);
+  pthread_mutexattr_init(&my_fast_mutexattr);
+  pthread_mutexattr_settype(&my_fast_mutexattr,
+                            PTHREAD_MUTEX_ADAPTIVE_NP);
 #endif
 
   pthread_mutex_init(&THR_LOCK_malloc,MY_MUTEX_INIT_FAST);
@@ -108,9 +107,6 @@
   pthread_key_delete(THR_KEY_mysys);
 #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
   pthread_mutexattr_destroy(&my_fast_mutexattr);
-#endif
-#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
-  pthread_mutexattr_destroy(&my_errchk_mutexattr);
 #endif
   pthread_mutex_destroy(&THR_LOCK_malloc);
   pthread_mutex_destroy(&THR_LOCK_open);

--- 1.6/cmd-line-utils/libedit/makelist.sh	2005-01-08 05:30:18 +01:00
+++ 1.7/cmd-line-utils/libedit/makelist.sh	2005-04-27 09:59:09 +02:00
@@ -68,7 +68,7 @@
 	/\(\):/ {
 	    pr = substr($2, 1, 2);
 	    if (pr == "vi" || pr == "em" || pr == "ed") {
-		name = substr($2, 1, length($2) - 3);
+		name = substr($2, 1, index($2,"(") - 1);
 #
 # XXX:	need a space between name and prototype so that -fc and -fh
 #	parsing is much easier
@@ -97,7 +97,7 @@
 	/\(\):/ {
 	    pr = substr($2, 1, 2);
 	    if (pr == "vi" || pr == "em" || pr == "ed") {
-		name = substr($2, 1, length($2) - 3);
+		name = substr($2, 1, index($2,"(") - 1);
 		uname = "";
 		fname = "";
 		for (i = 1; i <= length(name); i++) {
@@ -117,6 +117,7 @@
 		printf("      \"");
 		for (i = 2; i < NF; i++)
 		    printf("%s ", $i);
+                sub("\r", "", $i);
 		printf("%s\" },\n", $i);
 		ok = 0;
 	    }
@@ -219,7 +220,7 @@
 	/\(\):/ {
 	    pr = substr($2, 1, 2);
 	    if (pr == "vi" || pr == "em" || pr == "ed") {
-		name = substr($2, 1, length($2) - 3);
+		name = substr($2, 1, index($2, "(") - 1);
 		fname = "";
 		for (i = 1; i <= length(name); i++) {
 		    s = substr(name, i, 1);
Thread
bk commit into 4.1 tree (msvensson:1.2207) BUG#9954msvensson27 Apr