summaryrefslogtreecommitdiff
path: root/innobase/os
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-06-02 17:58:18 +0300
committerunknown <heikki@hundin.mysql.fi>2003-06-02 17:58:18 +0300
commit35ce8465d9557cc31304ca24c843a5eab5c25053 (patch)
treef055e7e7393f5731c11ad415a771038c85c8d05b /innobase/os
parenta1a4903b53201f935f35a196cd9ae6ad15f7a2ce (diff)
downloadmariadb-git-35ce8465d9557cc31304ca24c843a5eab5c25053.tar.gz
os0sync.c:
Do not try to reserve os_sync_mutex in shutdown after it has been freed innobase/os/os0sync.c: Do not try to reserve os_sync_mutex in shutdown after it has been freed
Diffstat (limited to 'innobase/os')
-rw-r--r--innobase/os/os0sync.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c
index 0fe61fe570d..bf5fc57bf57 100644
--- a/innobase/os/os0sync.c
+++ b/innobase/os/os0sync.c
@@ -88,6 +88,12 @@ os_sync_free(void)
mutex = UT_LIST_GET_FIRST(os_mutex_list);
while (mutex) {
+ if (mutex == os_sync_mutex) {
+ /* Set the flag to FALSE so that we do not try to
+ reserve os_sync_mutex any more in remaining freeing
+ operations in shutdown */
+ os_sync_mutex_inited = FALSE;
+ }
os_mutex_free(mutex);
@@ -517,13 +523,17 @@ os_mutex_free(
{
ut_a(mutex);
- os_mutex_enter(os_sync_mutex);
+ if (os_sync_mutex_inited) {
+ os_mutex_enter(os_sync_mutex);
+ }
UT_LIST_REMOVE(os_mutex_list, os_mutex_list, mutex);
os_mutex_count--;
- os_mutex_exit(os_sync_mutex);
+ if (os_sync_mutex_inited) {
+ os_mutex_exit(os_sync_mutex);
+ }
#ifdef __WIN__
ut_a(CloseHandle(mutex->handle));
@@ -614,9 +624,16 @@ os_fast_mutex_free(
#else
ut_a(0 == pthread_mutex_destroy(fast_mutex));
#endif
- os_mutex_enter(os_sync_mutex);
+ if (os_sync_mutex_inited) {
+ /* When freeing the last mutexes, we have
+ already freed os_sync_mutex */
+
+ os_mutex_enter(os_sync_mutex);
+ }
os_fast_mutex_count--;
- os_mutex_exit(os_sync_mutex);
+ if (os_sync_mutex_inited) {
+ os_mutex_exit(os_sync_mutex);
+ }
}