Skip to content

Commit 12afea7

Browse files
committed
Merge of fix 18351022, cset 7640 from trunk
1 parent 9353062 commit 12afea7

File tree

5 files changed

+27
-39
lines changed

5 files changed

+27
-39
lines changed

storage/innobase/include/srv0conc.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 2011, 2014, Oracle and/or its affiliates. All Rights Reserved.
44
55
Portions of this file contain modifications contributed and copyrighted by
66
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -52,17 +52,20 @@ we could get a deadlock. Value of 0 will disable the concurrency check. */
5252

5353
extern ulong srv_thread_concurrency;
5454

55-
/*********************************************************************//**
56-
Initialise the concurrency management data structures */
55+
#ifndef HAVE_ATOMIC_BUILTINS
56+
/** Mutex protecting some server global variables. */
57+
extern ib_mutex_t server_mutex;
58+
59+
/** Initialise the concurrency management data structures. */
60+
5761
void
5862
srv_conc_init(void);
59-
/*===============*/
6063

61-
/*********************************************************************//**
62-
Free the concurrency management data structures */
64+
/** Free the concurrency management data structures. */
65+
6366
void
6467
srv_conc_free(void);
65-
/*===============*/
68+
#endif /* !HAVE_ATOMIC_BUILTINS */
6669

6770
/*********************************************************************//**
6871
Puts an OS thread to wait if there are too many concurrent threads

storage/innobase/include/srv0srv.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,6 @@ extern ulint srv_fatal_semaphore_wait_threshold;
376376
#define SRV_SEMAPHORE_WAIT_EXTENSION 7200
377377
extern ulint srv_dml_needed_delay;
378378

379-
#ifndef HAVE_ATOMIC_BUILTINS
380-
/** Mutex protecting some server global variables. */
381-
extern ib_mutex_t server_mutex;
382-
#endif /* !HAVE_ATOMIC_BUILTINS */
383-
384379
#define SRV_MAX_N_IO_THREADS 130
385380

386381
/* Array of English strings describing the current state of an

storage/innobase/srv/srv0conc.cc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 2011, 2014, Oracle and/or its affiliates. All Rights Reserved.
44
55
Portions of this file contain modifications contributed and copyrighted by
66
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -69,6 +69,8 @@ we could get a deadlock. Value of 0 will disable the concurrency check. */
6969
ulong srv_thread_concurrency = 0;
7070

7171
#ifndef HAVE_ATOMIC_BUILTINS
72+
/** Mutex protecting some server global variables. */
73+
ib_mutex_t server_mutex;
7274

7375
/** This mutex protects srv_conc data structures */
7476
static SysMutex srv_conc_mutex;
@@ -118,13 +120,12 @@ struct srv_conc_t {
118120
/* Control variables for tracking concurrency. */
119121
static srv_conc_t srv_conc;
120122

121-
/*********************************************************************//**
122-
Initialise the concurrency management data structures */
123+
#ifndef HAVE_ATOMIC_BUILTINS
124+
/** Initialise the concurrency management data structures. */
125+
123126
void
124127
srv_conc_init(void)
125-
/*===============*/
126128
{
127-
#ifndef HAVE_ATOMIC_BUILTINS
128129
ulint i;
129130

130131
/* Init the server concurrency restriction data structures */
@@ -142,21 +143,21 @@ srv_conc_init(void)
142143
conc_slot->event = os_event_create("conc_event");
143144
ut_a(conc_slot->event);
144145
}
145-
#endif /* !HAVE_ATOMIC_BUILTINS */
146+
147+
mutex_create("server", &server_mutex);
146148
}
147149

148-
/*********************************************************************//**
149-
Free the concurrency management data structures */
150+
/** Free the concurrency management data structures. */
151+
150152
void
151153
srv_conc_free(void)
152-
/*===============*/
153154
{
154-
#ifndef HAVE_ATOMIC_BUILTINS
155+
mutex_free(&server_mutex);
155156
mutex_free(&srv_conc_mutex);
156157
ut_free(srv_conc_slots);
157158
srv_conc_slots = NULL;
158-
#endif /* !HAVE_ATOMIC_BUILTINS */
159159
}
160+
#endif /* !HAVE_ATOMIC_BUILTINS */
160161

161162
#ifdef HAVE_ATOMIC_BUILTINS
162163
/*********************************************************************//**

storage/innobase/srv/srv0srv.cc

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -502,11 +502,6 @@ struct srv_sys_t{
502502
activity */
503503
};
504504

505-
#ifndef HAVE_ATOMIC_BUILTINS
506-
/** Mutex protecting some server global variables. */
507-
ib_mutex_t server_mutex;
508-
#endif /* !HAVE_ATOMIC_BUILTINS */
509-
510505
static srv_sys_t* srv_sys = NULL;
511506

512507
/** Event to signal the monitor thread. */
@@ -840,10 +835,6 @@ srv_init(void)
840835
ulint n_sys_threads = 0;
841836
ulint srv_sys_sz = sizeof(*srv_sys);
842837

843-
#ifndef HAVE_ATOMIC_BUILTINS
844-
mutex_create("server", &server_mutex);
845-
#endif /* !HAVE_ATOMIC_BUILTINS */
846-
847838
mutex_create("srv_innodb_monitor", &srv_innodb_monitor_mutex);
848839

849840
if (!srv_read_only_mode) {
@@ -897,8 +888,9 @@ srv_init(void)
897888
/* Create dummy indexes for infimum and supremum records */
898889

899890
dict_ind_init();
900-
891+
#ifndef HAVE_ATOMIC_BUILTINS
901892
srv_conc_init();
893+
#endif /* !HAVE_ATOMIC_BUILTINS */
902894

903895
/* Initialize some INFORMATION SCHEMA internal structures */
904896
trx_i_s_cache_init(trx_i_s_cache);
@@ -913,12 +905,6 @@ void
913905
srv_free(void)
914906
/*==========*/
915907
{
916-
srv_conc_free();
917-
918-
#ifndef HAVE_ATOMIC_BUILTINS
919-
mutex_free(&server_mutex);
920-
#endif /* !HAVE_ATOMIC_BUILTINS */
921-
922908
mutex_free(&srv_innodb_monitor_mutex);
923909
mutex_free(&page_zip_stat_per_index_mutex);
924910

storage/innobase/srv/srv0start.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,6 +2542,9 @@ innobase_shutdown_for_mysql(void)
25422542
pars_lexer_close();
25432543
log_mem_free();
25442544
buf_pool_free(srv_buf_pool_instances);
2545+
#ifndef HAVE_ATOMIC_BUILTINS
2546+
srv_conc_free();
2547+
#endif /* !HAVE_ATOMIC_BUILTINS */
25452548

25462549
/* 6. Free the thread management resoruces. */
25472550
os_thread_free();

0 commit comments

Comments
 (0)