diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-04-15 01:40:00 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-04-15 01:40:00 +0200 |
commit | 8bf7aae23e4448df3ec2a86f04d0a166fafdd1e6 (patch) | |
tree | 694a9217d62c90d6641b7040b8725d3ba1ba30fa /mysys/waiting_threads.c | |
parent | 87b6f241064beb8f94669ba438e8c9c479016e76 (diff) | |
download | mariadb-git-8bf7aae23e4448df3ec2a86f04d0a166fafdd1e6.tar.gz |
fix application verifier crashes
Diffstat (limited to 'mysys/waiting_threads.c')
-rw-r--r-- | mysys/waiting_threads.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mysys/waiting_threads.c b/mysys/waiting_threads.c index ddc06a3ae5e..f7e74e012d2 100644 --- a/mysys/waiting_threads.c +++ b/mysys/waiting_threads.c @@ -423,6 +423,8 @@ static void wt_resource_destroy(uchar *arg) DBUG_VOID_RETURN; } +static int wt_init_done; + void wt_init() { DBUG_ENTER("wt_init"); @@ -456,18 +458,22 @@ void wt_init() my_atomic_rwlock_init(&cycle_stats_lock); my_atomic_rwlock_init(&success_stats_lock); my_atomic_rwlock_init(&wait_stats_lock); + wt_init_done= 1; DBUG_VOID_RETURN; } void wt_end() { DBUG_ENTER("wt_end"); + if (!wt_init_done) + DBUG_VOID_RETURN; DBUG_ASSERT(reshash.count == 0); lf_hash_destroy(&reshash); my_atomic_rwlock_destroy(&cycle_stats_lock); my_atomic_rwlock_destroy(&success_stats_lock); my_atomic_rwlock_destroy(&wait_stats_lock); + wt_init_done= 0; DBUG_VOID_RETURN; } |