summaryrefslogtreecommitdiff
path: root/server-tools/instance-manager/priv.cc
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.local>2006-11-17 16:11:04 +0300
committerunknown <kostja@bodhi.local>2006-11-17 16:11:04 +0300
commita163ae30f23239e1f7a9efafc620e1bc74e009ba (patch)
tree5ecdad467c796454f72a94e294ff4958563441fb /server-tools/instance-manager/priv.cc
parent211b2bc92a25609e0c7323b5fee6f646abb3c748 (diff)
downloadmariadb-git-a163ae30f23239e1f7a9efafc620e1bc74e009ba.tar.gz
Replace the approach using Foo_thread_args + Foo_thread and manually
spawned threads with a reusable class Thread. This is the second idea implemented in the Alik's patch for BUG#22306: STOP INSTANCE can not be applied for instances in Crashed, Failed and Abandoned. Commiting separately to ease review process. server-tools/instance-manager/commands.cc: Remove an unused header. server-tools/instance-manager/guardian.cc: Use Thread framework instead of manually spawning the Guardian thread. Tidy up. server-tools/instance-manager/guardian.h: Use Thread framework instead of manually spawning the Guardian thread. server-tools/instance-manager/instance.cc: Use Thread framework instead of manually spawning the instance monitoring thread. server-tools/instance-manager/listener.cc: Use Thread framework instead of manually spawning the mysql connection thread. server-tools/instance-manager/listener.h: Use Thread framework instead of manually spawning the mysql connection thread. Rename Listener_thread to Listener for brevity. server-tools/instance-manager/manager.cc: Change references to pointers, as per the coding style. Use Thread framework instead of manually spawning threads. server-tools/instance-manager/mysql_connection.cc: Get rid of Mysql_connection_thread_args. Use class Thread framework instead. Rename Mysql_connection_thread to Mysql_connection for brevity. server-tools/instance-manager/mysql_connection.h: Get rid of Mysql_connection_thread_args. Use class Thread framework instead. Rename Mysql_connection_thread to Mysql_connection for brevity. server-tools/instance-manager/priv.cc: Move set_stacksize_and_create_thread to thread_registry.cc and make it static: it is not used anywhere else now. server-tools/instance-manager/priv.h: No public set_stacksize_n_create_thread server-tools/instance-manager/thread_registry.cc: Implement a base Thread class to be used for all Instance Manager threads. server-tools/instance-manager/thread_registry.h: Implement a base Thread class to be used for all Instance Manager threads.
Diffstat (limited to 'server-tools/instance-manager/priv.cc')
-rw-r--r--server-tools/instance-manager/priv.cc38
1 files changed, 0 insertions, 38 deletions
diff --git a/server-tools/instance-manager/priv.cc b/server-tools/instance-manager/priv.cc
index 7e3553444ac..934684a1a06 100644
--- a/server-tools/instance-manager/priv.cc
+++ b/server-tools/instance-manager/priv.cc
@@ -22,17 +22,6 @@
#include "log.h"
-#if defined(__ia64__) || defined(__ia64)
-/*
- We can live with 32K, but reserve 64K. Just to be safe.
- On ia64 we need to reserve double of the size.
-*/
-#define IM_THREAD_STACK_SIZE (128*1024L)
-#else
-#define IM_THREAD_STACK_SIZE (64*1024)
-#endif
-
-
/* the pid of the manager process (of the signal thread on the LinuxThreads) */
pid_t manager_pid;
@@ -66,33 +55,6 @@ unsigned long bytes_sent = 0L, bytes_received = 0L;
unsigned long mysqld_net_retry_count = 10L;
unsigned long open_files_limit;
-/*
- Change the stack size and start a thread. Return an error if either
- pthread_attr_setstacksize or pthread_create fails.
- Arguments are the same as for pthread_create().
-*/
-
-int set_stacksize_n_create_thread(pthread_t *thread, pthread_attr_t *attr,
- void *(*start_routine)(void *), void *arg)
-{
- int rc= 0;
-
-#ifndef __WIN__
-#ifndef PTHREAD_STACK_MIN
-#define PTHREAD_STACK_MIN 32768
-#endif
- /*
- Set stack size to be safe on the platforms with too small
- default thread stack.
- */
- rc= pthread_attr_setstacksize(attr,
- (size_t) (PTHREAD_STACK_MIN +
- IM_THREAD_STACK_SIZE));
-#endif
- if (!rc)
- rc= pthread_create(thread, attr, start_routine, arg);
- return rc;
-}
int create_pid_file(const char *pid_file_name, int pid)