Below is the list of changes that have just been committed into a local
5.0 repository of kostja. When kostja 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://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.1568 03/08/22 01:05:16 kostja@stripped +9 -0
Thread_repository -> Thread_registry
server-tools/instance-manager/thread_registry.h
1.3 03/08/22 01:05:14 kostja@stripped +13 -13
Thread_repository -> Thread_registry
server-tools/instance-manager/thread_registry.cc
1.5 03/08/22 01:05:14 kostja@stripped +27 -27
Thread_repository -> Thread_registry
server-tools/instance-manager/mysql_connection.h
1.3 03/08/22 01:05:14 kostja@stripped +4 -4
Thread_repository -> Thread_registry
server-tools/instance-manager/mysql_connection.cc
1.3 03/08/22 01:05:14 kostja@stripped +5 -5
Thread_repository -> Thread_registry
server-tools/instance-manager/manager.h
1.3 03/08/22 01:05:14 kostja@stripped +1 -1
minor fix
server-tools/instance-manager/manager.cc
1.5 03/08/22 01:05:14 kostja@stripped +4 -4
Thread_repository -> Thread_registry
server-tools/instance-manager/listener.h
1.4 03/08/22 01:05:14 kostja@stripped +4 -4
Thread_repository -> Thread_registry
server-tools/instance-manager/listener.cc
1.4 03/08/22 01:05:14 kostja@stripped +6 -6
Thread_repository -> Thread_registry
server-tools/instance-manager/Makefile.am
1.4 03/08/22 01:05:14 kostja@stripped +1 -1
thread_repository.{h,cc} -> thread_registry.{h,cc}
server-tools/instance-manager/thread_registry.cc
1.4 03/08/22 01:00:30 kostja@stripped +0 -0
Rename: server-tools/instance-manager/thread_repository.cc -> server-tools/instance-manager/thread_registry.cc
server-tools/instance-manager/thread_registry.h
1.2 03/08/22 01:00:06 kostja@stripped +0 -0
Rename: server-tools/instance-manager/thread_repository.h -> server-tools/instance-manager/thread_registry.h
# 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: kostja
# Host: oak.local
# Root: /home/kostja/mysql/mysql-5.0-im
--- 1.3/server-tools/instance-manager/Makefile.am Thu Aug 21 00:37:38 2003
+++ 1.4/server-tools/instance-manager/Makefile.am Fri Aug 22 01:05:14 2003
@@ -16,7 +16,7 @@
bin_PROGRAMS = mysqlmanager
mysqlmanager_SOURCES= mysqlmanager.cc manager.h manager.cc log.h log.cc \
- thread_repository.h thread_repository.cc \
+ thread_registry.h thread_registry.cc \
listener.h listener.cc \
mysql_connection.h mysql_connection.cc
--- 1.3/server-tools/instance-manager/listener.cc Fri Aug 22 00:58:37 2003
+++ 1.4/server-tools/instance-manager/listener.cc Fri Aug 22 01:05:14 2003
@@ -25,7 +25,7 @@
#include <violite.h>
#include <sys/un.h>
-#include "thread_repository.h"
+#include "thread_registry.h"
#include "log.h"
#include "mysql_connection.h"
@@ -48,9 +48,9 @@
pthread_handler_decl(listener, arg)
{
Listener_thread_args *args= (Listener_thread_args *) arg;
- Thread_repository &thread_repository= args->thread_repository;
+ Thread_registry &thread_registry= args->thread_registry;
Thread_info info(pthread_self());
- thread_repository.register_thread(&info);
+ thread_registry.register_thread(&info);
/* I. prepare 'listen' sockets */
@@ -98,7 +98,7 @@
FD_ZERO(&read_fds);
FD_SET(unix_socket, &read_fds);
- while (thread_repository.is_shutdown() == false)
+ while (thread_registry.is_shutdown() == false)
{
fd_set read_fds_arg= read_fds;
int rc= select(max_fd_no + 1, &read_fds_arg, 0, 0, 0);
@@ -132,7 +132,7 @@
close(unix_socket);
unlink(unix_socket_address.sun_path);
- thread_repository.unregister_thread(&info);
+ thread_registry.unregister_thread(&info);
return 0;
}
@@ -149,7 +149,7 @@
static void handle_new_mysql_connection(Vio *vio, Listener_thread_args *args)
{
if (Mysql_connection_thread_args *mysql_thread_args=
- new Mysql_connection_thread_args(vio, args->thread_repository))
+ new Mysql_connection_thread_args(vio, args->thread_registry))
{
/*
Initialize thread attributes to create detached thread; it seems
--- 1.3/server-tools/instance-manager/listener.h Fri Aug 22 00:58:37 2003
+++ 1.4/server-tools/instance-manager/listener.h Fri Aug 22 01:05:14 2003
@@ -30,16 +30,16 @@
C_MODE_END
-class Thread_repository;
+class Thread_registry;
struct Listener_thread_args
{
- Thread_repository &thread_repository;
+ Thread_registry &thread_registry;
const char *socket_file_name;
- Listener_thread_args(Thread_repository &thread_repository_arg,
+ Listener_thread_args(Thread_registry &thread_registry_arg,
const char *socket_file_name_arg) :
- thread_repository(thread_repository_arg),
+ thread_registry(thread_registry_arg),
socket_file_name(socket_file_name_arg) {}
};
--- 1.4/server-tools/instance-manager/manager.cc Fri Aug 22 00:58:37 2003
+++ 1.5/server-tools/instance-manager/manager.cc Fri Aug 22 01:05:14 2003
@@ -19,7 +19,7 @@
#include <my_global.h>
#include <signal.h>
-#include "thread_repository.h"
+#include "thread_registry.h"
#include "listener.h"
#include "log.h"
@@ -33,8 +33,8 @@
void manager(const char *socket_file_name)
{
- Thread_repository thread_repository;
- Listener_thread_args listener_args(thread_repository, socket_file_name);
+ Thread_registry thread_registry;
+ Listener_thread_args listener_args(thread_registry, socket_file_name);
/* write pid file */
@@ -65,7 +65,7 @@
*/
int signo;
sigwait(&mask, &signo);
- thread_repository.deliver_shutdown();
+ thread_registry.deliver_shutdown();
/* delete the pid file */
--- 1.2/server-tools/instance-manager/manager.h Tue Aug 19 19:55:18 2003
+++ 1.3/server-tools/instance-manager/manager.h Fri Aug 22 01:05:14 2003
@@ -1,6 +1,6 @@
#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H
#define INCLUDES_MYSQL_INSTANCE_MANAGER_MANAGER_H
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2003 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
--- 1.2/server-tools/instance-manager/mysql_connection.cc Fri Aug 22 00:58:37 2003
+++ 1.3/server-tools/instance-manager/mysql_connection.cc Fri Aug 22 01:05:14 2003
@@ -23,7 +23,7 @@
#include <mysql.h>
#include <violite.h>
-#include "thread_repository.h"
+#include "thread_registry.h"
#include "log.h"
@@ -38,12 +38,12 @@
pthread_handler_decl(mysql_connection, arg)
{
Mysql_connection_thread_args *args= (Mysql_connection_thread_args *) arg;
- Thread_repository &thread_repository= args->thread_repository;
+ Thread_registry &thread_registry= args->thread_registry;
Vio *vio= args->vio;
Thread_info info(pthread_self());
- thread_repository.register_thread(&info);
+ thread_registry.register_thread(&info);
- while (thread_repository.is_shutdown() == false)
+ while (thread_registry.is_shutdown() == false)
{
log_error("mysql_connection is alive");
sleep(2);
@@ -52,7 +52,7 @@
vio_delete(vio);
delete args;
- thread_repository.unregister_thread(&info);
+ thread_registry.unregister_thread(&info);
return 0;
}
--- 1.2/server-tools/instance-manager/mysql_connection.h Fri Aug 22 00:58:37 2003
+++ 1.3/server-tools/instance-manager/mysql_connection.h Fri Aug 22 01:05:14 2003
@@ -31,17 +31,17 @@
C_MODE_END
-class Thread_repository;
+class Thread_registry;
struct st_vio;
struct Mysql_connection_thread_args
{
struct st_vio *vio;
- Thread_repository &thread_repository;
+ Thread_registry &thread_registry;
Mysql_connection_thread_args(struct st_vio *vio_arg,
- Thread_repository &thread_repository_arg) :
- vio(vio_arg), thread_repository(thread_repository_arg) {}
+ Thread_registry &thread_registry_arg) :
+ vio(vio_arg), thread_registry(thread_registry_arg) {}
};
#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_MYSQL_CONNECTION_H
--- 1.3/server-tools/instance-manager/thread_repository.cc Fri Aug 22 00:58:37 2003
+++ 1.5/server-tools/instance-manager/thread_registry.cc Fri Aug 22 01:05:14 2003
@@ -18,7 +18,7 @@
#pragma implementation
#endif
-#include "thread_repository.h"
+#include "thread_registry.h"
#include <assert.h>
#include <signal.h>
#include "log.h"
@@ -39,28 +39,28 @@
a particular thread, not to the whole worker crew
*/
-Thread_repository::Thread_repository() :
+Thread_registry::Thread_registry() :
shutdown_in_progress(false)
{
- pthread_mutex_init(&LOCK_thread_repository, 0);
- pthread_cond_init(&COND_thread_repository_is_empty, 0);
+ pthread_mutex_init(&LOCK_thread_registry, 0);
+ pthread_cond_init(&COND_thread_registry_is_empty, 0);
/* head is used by-value to simplify nodes inserting */
head.next= head.prev= &head;
}
-Thread_repository::~Thread_repository()
+Thread_registry::~Thread_registry()
{
/* Check that no one uses the repository. */
- pthread_mutex_lock(&LOCK_thread_repository);
+ pthread_mutex_lock(&LOCK_thread_registry);
/* All threads must unregister */
DBUG_ASSERT(head.next == &head);
- pthread_mutex_unlock(&LOCK_thread_repository);
- pthread_cond_destroy(&COND_thread_repository_is_empty);
- pthread_mutex_destroy(&LOCK_thread_repository);
+ pthread_mutex_unlock(&LOCK_thread_registry);
+ pthread_cond_destroy(&COND_thread_registry_is_empty);
+ pthread_mutex_destroy(&LOCK_thread_registry);
}
@@ -70,7 +70,7 @@
points to the last node.
*/
-void Thread_repository::register_thread(Thread_info *info)
+void Thread_registry::register_thread(Thread_info *info)
{
struct sigaction sa;
sa.sa_handler= handle_signal;
@@ -80,12 +80,12 @@
info->current_cond= 0;
- pthread_mutex_lock(&LOCK_thread_repository);
+ pthread_mutex_lock(&LOCK_thread_registry);
info->next= &head;
info->prev= head.prev;
head.prev->next= info;
head.prev= info;
- pthread_mutex_unlock(&LOCK_thread_repository);
+ pthread_mutex_unlock(&LOCK_thread_registry);
}
@@ -95,14 +95,14 @@
thing a thread is doing, otherwise it could have no time to finalize.
*/
-void Thread_repository::unregister_thread(Thread_info *info)
+void Thread_registry::unregister_thread(Thread_info *info)
{
- pthread_mutex_lock(&LOCK_thread_repository);
+ pthread_mutex_lock(&LOCK_thread_registry);
info->prev->next= info->next;
info->next->prev= info->prev;
if (head.next == &head)
- pthread_cond_signal(&COND_thread_repository_is_empty);
- pthread_mutex_unlock(&LOCK_thread_repository);
+ pthread_cond_signal(&COND_thread_registry_is_empty);
+ pthread_mutex_unlock(&LOCK_thread_registry);
}
@@ -115,24 +115,24 @@
return value from pthread_cond_wait
*/
-int Thread_repository::cond_wait(Thread_info *info, pthread_cond_t *cond,
+int Thread_registry::cond_wait(Thread_info *info, pthread_cond_t *cond,
pthread_mutex_t *mutex, bool *is_shutdown)
{
- pthread_mutex_lock(&LOCK_thread_repository);
+ pthread_mutex_lock(&LOCK_thread_registry);
*is_shutdown= shutdown_in_progress;
if (*is_shutdown)
{
- pthread_mutex_unlock(&LOCK_thread_repository);
+ pthread_mutex_unlock(&LOCK_thread_registry);
return 0;
}
info->current_cond= cond;
- pthread_mutex_unlock(&LOCK_thread_repository);
+ pthread_mutex_unlock(&LOCK_thread_registry);
/* sic: race condition here, cond can be signaled in deliver_shutdown */
int rc= pthread_cond_wait(cond, mutex);
- pthread_mutex_lock(&LOCK_thread_repository);
+ pthread_mutex_lock(&LOCK_thread_registry);
info->current_cond= 0;
*is_shutdown= shutdown_in_progress;
- pthread_mutex_unlock(&LOCK_thread_repository);
+ pthread_mutex_unlock(&LOCK_thread_registry);
return rc;
}
@@ -143,12 +143,12 @@
again.
*/
-void Thread_repository::deliver_shutdown()
+void Thread_registry::deliver_shutdown()
{
struct timespec shutdown_time;
set_timespec(shutdown_time, 1);
- pthread_mutex_lock(&LOCK_thread_repository);
+ pthread_mutex_lock(&LOCK_thread_registry);
shutdown_in_progress= true;
for (Thread_info *info= head.next; info != &head; info= info->next)
{
@@ -167,8 +167,8 @@
released - the only case when the predicate is false is when no other
threads exist.
*/
- while (pthread_cond_timedwait(&COND_thread_repository_is_empty,
- &LOCK_thread_repository,
+ while (pthread_cond_timedwait(&COND_thread_registry_is_empty,
+ &LOCK_thread_registry,
&shutdown_time) != ETIMEDOUT &&
head.next != &head)
;
@@ -185,6 +185,6 @@
if (info->current_cond)
pthread_cond_signal(info->current_cond);
}
- pthread_mutex_unlock(&LOCK_thread_repository);
+ pthread_mutex_unlock(&LOCK_thread_registry);
}
--- 1.1/server-tools/instance-manager/thread_repository.h Tue Aug 19 19:55:18 2003
+++ 1.3/server-tools/instance-manager/thread_registry.h Fri Aug 22 01:05:14 2003
@@ -1,5 +1,5 @@
-#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_THREAD_REPOSITORY_HH
-#define INCLUDES_MYSQL_INSTANCE_MANAGER_THREAD_REPOSITORY_HH
+#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_THREAD_REGISTRY_HH
+#define INCLUDES_MYSQL_INSTANCE_MANAGER_THREAD_REGISTRY_HH
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
@@ -71,22 +71,22 @@
Thread_info *prev, *next;
pthread_t thread_id;
Thread_info() {}
- friend class Thread_repository;
+ friend class Thread_registry;
public:
Thread_info(pthread_t thread_id_arg) : thread_id(thread_id_arg) {}
};
/*
- Thread_repository - contains handles for each worker thread to deliver
+ Thread_registry - contains handles for each worker thread to deliver
signal information to workers.
*/
-class Thread_repository
+class Thread_registry
{
public:
- Thread_repository();
- ~Thread_repository();
+ Thread_registry();
+ ~Thread_registry();
void register_thread(Thread_info *info);
void unregister_thread(Thread_info *info);
@@ -97,17 +97,17 @@
private:
Thread_info head;
bool shutdown_in_progress;
- pthread_mutex_t LOCK_thread_repository;
- pthread_cond_t COND_thread_repository_is_empty;
+ pthread_mutex_t LOCK_thread_registry;
+ pthread_cond_t COND_thread_registry_is_empty;
};
-inline bool Thread_repository::is_shutdown()
+inline bool Thread_registry::is_shutdown()
{
- pthread_mutex_lock(&LOCK_thread_repository);
+ pthread_mutex_lock(&LOCK_thread_registry);
bool res= shutdown_in_progress;
- pthread_mutex_unlock(&LOCK_thread_repository);
+ pthread_mutex_unlock(&LOCK_thread_registry);
return res;
}
-#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_THREAD_REPOSITORY_HH
+#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_THREAD_REGISTRY_HH
| Thread |
|---|
| • bk commit into 5.0 tree (1.1568) | konstantin | 21 Aug |