Skip to content

Commit

Permalink
Fixed build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Vojtovich committed Mar 22, 2018
1 parent 1123f87 commit e147a4a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
18 changes: 12 additions & 6 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,15 @@ thd_destructor_proxy(void *)
myvar->current_cond = &thd_destructor_cond;

mysql_mutex_lock(&thd_destructor_mutex);
my_atomic_storeptr_explicit(&srv_running, myvar,
my_atomic_storeptr_explicit(reinterpret_cast<void**>(&srv_running),
myvar,
MY_MEMORY_ORDER_RELAXED);
/* wait until the server wakes the THD to abort and die */
while (!srv_running->abort)
mysql_cond_wait(&thd_destructor_cond, &thd_destructor_mutex);
mysql_mutex_unlock(&thd_destructor_mutex);
my_atomic_storeptr_explicit(&srv_running, NULL,
my_atomic_storeptr_explicit(reinterpret_cast<void**>(&srv_running),
NULL,
MY_MEMORY_ORDER_RELAXED);

while (srv_fast_shutdown == 0 &&
Expand Down Expand Up @@ -4335,7 +4337,8 @@ innobase_init(
mysql_thread_create(thd_destructor_thread_key,
&thd_destructor_thread,
NULL, thd_destructor_proxy, NULL);
while (!my_atomic_loadptr_explicit(&srv_running,
while (!my_atomic_loadptr_explicit(reinterpret_cast<void**>
(&srv_running),
MY_MEMORY_ORDER_RELAXED))
os_thread_sleep(20);
}
Expand Down Expand Up @@ -4430,8 +4433,10 @@ innobase_end(handlerton*, ha_panic_function)
hash_table_free(innobase_open_tables);
innobase_open_tables = NULL;

st_my_thread_var* running = my_atomic_loadptr_explicit(
&srv_running, MY_MEMORY_ORDER_RELAXED);
st_my_thread_var* running = reinterpret_cast<st_my_thread_var*>(
my_atomic_loadptr_explicit(
reinterpret_cast<void**>(&srv_running),
MY_MEMORY_ORDER_RELAXED));
if (!abort_loop && running) {
// may be UNINSTALL PLUGIN statement
running->abort = 1;
Expand Down Expand Up @@ -17770,7 +17775,8 @@ fast_shutdown_validate(
uint new_val = *reinterpret_cast<uint*>(save);

if (srv_fast_shutdown && !new_val
&& !my_atomic_loadptr_explicit(&srv_running,
&& !my_atomic_loadptr_explicit(reinterpret_cast<void**>
(&srv_running),
MY_MEMORY_ORDER_RELAXED)) {
return(1);
}
Expand Down
3 changes: 2 additions & 1 deletion storage/innobase/include/ib0mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ struct TTASEventMutex {
int32 state() const
UNIV_NOTHROW
{
return(my_atomic_load32_explicit(&m_lock_word,
return(my_atomic_load32_explicit(const_cast<int32*>
(&m_lock_word),
MY_MEMORY_ORDER_RELAXED));
}

Expand Down
3 changes: 2 additions & 1 deletion storage/innobase/srv/srv0srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2942,7 +2942,8 @@ srv_purge_wakeup()

srv_release_threads(SRV_WORKER, n_workers);
}
} while (!my_atomic_loadptr_explicit(&srv_running,
} while (!my_atomic_loadptr_explicit(reinterpret_cast<void**>
(&srv_running),
MY_MEMORY_ORDER_RELAXED)
&& (srv_sys.n_threads_active[SRV_WORKER]
|| srv_sys.n_threads_active[SRV_PURGE]));
Expand Down
3 changes: 2 additions & 1 deletion storage/innobase/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2839,7 +2839,8 @@ srv_shutdown_bg_undo_sources()
void
innodb_shutdown()
{
ut_ad(!my_atomic_loadptr_explicit(&srv_running,
ut_ad(!my_atomic_loadptr_explicit(reinterpret_cast<void**>
(&srv_running),
MY_MEMORY_ORDER_RELAXED));
ut_ad(!srv_undo_sources);

Expand Down

0 comments on commit e147a4a

Please sign in to comment.