File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -4051,10 +4051,11 @@ innobase_init(
40514051 DBUG_RETURN(HA_ERR_INITIALIZATION);
40524052 }
40534053# endif /* UNIV_DEBUG */
4054- os_event_global_init();
40554054
40564055#endif /* HAVE_PSI_INTERFACE */
40574056
4057+ os_event_global_init();
4058+
40584059 /* Set buffer pool size to default for fast startup when mysqld is
40594060 run with --help --verbose options. */
40604061 ulint srv_buf_pool_size_org = 0;
Original file line number Diff line number Diff line change @@ -253,6 +253,7 @@ struct os_event {
253253 enabled for the cond_attr object. */
254254 static bool cond_attr_has_monotonic_clock;
255255#endif /* !_WIN32 */
256+ static bool global_initialized;
256257
257258public:
258259 event_iter_t event_iter; /* !< For O(1) removal from
@@ -491,6 +492,7 @@ os_event::wait_time_low(
491492/* * Constructor */
492493os_event::os_event (const char * name) UNIV_NOTHROW
493494{
495+ ut_a (global_initialized);
494496 init ();
495497
496498 m_set = false ;
@@ -619,6 +621,7 @@ os_event_destroy(
619621pthread_condattr_t os_event::cond_attr;
620622bool os_event::cond_attr_has_monotonic_clock (false );
621623#endif /* !_WIN32 */
624+ bool os_event::global_initialized (false );
622625
623626
624627void os_event_global_init (void ) {
@@ -643,9 +646,11 @@ void os_event_global_init(void) {
643646
644647#endif /* UNIV_LINUX */
645648#endif /* !_WIN32 */
649+ os_event::global_initialized = true ;
646650}
647651
648652void os_event_global_destroy (void ) {
653+ ut_a (os_event::global_initialized);
649654#ifndef _WIN32
650655 os_event::cond_attr_has_monotonic_clock = false ;
651656#ifdef UNIV_DEBUG
@@ -654,4 +659,5 @@ void os_event_global_destroy(void) {
654659 pthread_condattr_destroy (&os_event::cond_attr);
655660 ut_ad (ret == 0 );
656661#endif /* !_WIN32 */
662+ os_event::global_initialized = false ;
657663}
Original file line number Diff line number Diff line change 1- /* Copyright (c) 2014, 2017 , Oracle and/or its affiliates. All rights reserved.
1+ /* Copyright (c) 2014, 2019 , Oracle and/or its affiliates. All rights reserved.
22
33 This program is free software; you can redistribute it and/or modify
44 it under the terms of the GNU General Public License as published by
2121#include " univ.i"
2222
2323#include " mem0mem.h"
24+ #include " os0event.h"
2425#include " srv0conc.h"
2526#include " srv0srv.h"
2627
@@ -37,13 +38,15 @@ class mem0mem : public ::testing::Test {
3738 SetUpTestCase ()
3839 {
3940 srv_max_n_threads = srv_sync_array_size + 1 ;
41+ os_event_global_init ();
4042 sync_check_init ();
4143 }
4244 static
4345 void
4446 TearDownTestCase ()
4547 {
4648 sync_check_close ();
49+ os_event_global_destroy ();
4750 }
4851};
4952
You can’t perform that action at this time.
0 commit comments