List:Commits« Previous MessageNext Message »
From:ahristov Date:January 31 2006 10:41pm
Subject:bk commit into 5.1 tree (andrey:1.2114) BUG#16984
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey 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.2114 06/01/31 23:41:21 andrey@lmy004. +1 -0
  - use the connection_attib used to spawn threads
    in the server. this fixes the problem with the limited number of
    threads because of them being non-detached. pthread_detach_this_tread()
    expands to empty on most platforms including SuSE but pthread_detach(pthread_self())
    is not portable on Windows so the first macro should be used and the thread
    to be detached we have to create it as such.
  fix for bug#16984 (Events: running out of threads)
  WL#1034 (Internal CRON)

  sql/event_executor.cc
    1.23 06/01/31 23:41:11 andrey@lmy004. +4 -3
    - use the connection_attib used to spawn threads
      in the server. this fixes the problem with the limited number of
      threads because of them being non-detached. pthread_detach_this_tread()
      expands to empty on most platforms including SuSE but pthread_detach(pthread_self())
      is not portable on Windows so the first macro should be used and the thread
      to be detached we have to create it as such.

# 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:	andrey
# Host:	lmy004.
# Root:	/work/mysql-5.1-bug16984

--- 1.22/sql/event_executor.cc	2006-01-30 17:54:11 +01:00
+++ 1.23/sql/event_executor.cc	2006-01-31 23:41:11 +01:00
@@ -31,6 +31,7 @@
 
 extern  ulong thread_created;
 extern const char *my_localhost;
+extern pthread_attr_t connection_attrib;
 
 pthread_mutex_t LOCK_event_arrays,
                 LOCK_workers_count,
@@ -41,7 +42,7 @@
 
 ulonglong evex_main_thread_id= 0;
 ulong opt_event_executor;
-volatile my_bool event_executor_running_global_var;
+my_bool event_executor_running_global_var;
 static my_bool evex_mutexes_initted= false;
 static uint workers_count;
 
@@ -102,7 +103,7 @@
   {
 #ifndef DBUG_FAULTY_THR
     //TODO Andrey: Change the error code returned!
-    if (pthread_create(&th, NULL, event_executor_main, (void*)NULL))
+    if (pthread_create(&th, &connection_attrib, event_executor_main,(void*)NULL))
       DBUG_RETURN(ER_SLAVE_THREAD);
 #else
     event_executor_main(NULL);
@@ -351,7 +352,7 @@
       ++iter_num;
       DBUG_PRINT("info", ("  Spawning a thread %d", iter_num));
 #ifndef DBUG_FAULTY_THR
-      if (pthread_create(&th, NULL, event_executor_worker, (void*)et))
+      if (pthread_create(&th,&connection_attrib,event_executor_worker,(void*)et))
       {
         sql_print_error("Problem while trying to create a thread");
         UNLOCK_MUTEX_AND_BAIL_OUT(LOCK_event_arrays, err);
Thread
bk commit into 5.1 tree (andrey:1.2114) BUG#16984ahristov31 Jan