1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix for BUG#17486: IM: race condition on exit.

The problem was that IM stoped guarded instances on shutdown,
but didn't wait for them to stop.

The fix is to wait for guarded instances to stop before exitting
from the main thread.

The idea is that Instance-monitoring thread should add itself
to Thread_registry so that it will be taken into account on shutdown.
However, Thread_registry should not signal it on shutdown in order to
not interrupt wait()/waitpid().
This commit is contained in:
anozdrin/alik@alik.
2006-10-24 18:23:16 +04:00
parent 06d943f137
commit f40a9d2ece
10 changed files with 203 additions and 71 deletions

View File

@ -27,6 +27,7 @@
#endif
class Instance_map;
class Thread_registry;
/*
@ -87,7 +88,7 @@ public:
static bool is_mysqld_compatible_name(const LEX_STRING *name);
public:
Instance();
Instance(Thread_registry &thread_registry_arg);
~Instance();
int init(const LEX_STRING *name_arg);
@ -120,6 +121,7 @@ public:
public:
enum { DEFAULT_SHUTDOWN_DELAY= 35 };
Instance_options options;
Thread_registry &thread_registry;
private:
/* This attributes is a flag, specifies if the instance has been crashed. */