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
55Portions of this file contain modifications contributed and copyrighted by 
66Google, 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. */
6969ulong	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 */ 
7476static  SysMutex	srv_conc_mutex;
@@ -118,13 +120,12 @@ struct srv_conc_t {
118120/*  Control variables for tracking concurrency. */ 
119121static  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+ 
123126void 
124127srv_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+ 
150152void 
151153srv_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/* ********************************************************************/ /* *
0 commit comments