mirror of
https://github.com/MariaDB/server.git
synced 2025-07-23 00:55:06 +00:00
MDEV-24512 fixup: Remove after_task_callback
In commitff5d306e29
we removed dbug_after_task_callback but forgot to revert the rest of commitbada05a883
.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2019, 2020, MariaDB Corporation.
|
/* Copyright (C) 2019, 2021, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute itand /or modify
|
This program is free software; you can redistribute itand /or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -21,21 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
|
|||||||
|
|
||||||
namespace tpool
|
namespace tpool
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
|
||||||
static callback_func_np after_task_callback;
|
|
||||||
void set_after_task_callback(callback_func_np cb)
|
|
||||||
{
|
|
||||||
after_task_callback= cb;
|
|
||||||
}
|
|
||||||
|
|
||||||
void execute_after_task_callback()
|
|
||||||
{
|
|
||||||
if (after_task_callback)
|
|
||||||
after_task_callback();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
task::task(callback_func func, void* arg, task_group* group) :
|
task::task(callback_func func, void* arg, task_group* group) :
|
||||||
m_func(func), m_arg(arg), m_group(group) {}
|
m_func(func), m_arg(arg), m_group(group) {}
|
||||||
|
|
||||||
@ -50,7 +35,6 @@ void execute_after_task_callback()
|
|||||||
{
|
{
|
||||||
/* Execute directly. */
|
/* Execute directly. */
|
||||||
m_func(m_arg);
|
m_func(m_arg);
|
||||||
dbug_execute_after_task_callback();
|
|
||||||
release();
|
release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,6 @@ namespace tpool
|
|||||||
if (t)
|
if (t)
|
||||||
{
|
{
|
||||||
t->m_func(t->m_arg);
|
t->m_func(t->m_arg);
|
||||||
dbug_execute_after_task_callback();
|
|
||||||
t->release();
|
t->release();
|
||||||
}
|
}
|
||||||
lk.lock();
|
lk.lock();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2019, 2020, MariaDB Corporation.
|
/* Copyright (C) 2019, 2021, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute itand /or modify
|
This program is free software; you can redistribute itand /or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -184,18 +184,6 @@ class thread_pool;
|
|||||||
|
|
||||||
extern aio *create_simulated_aio(thread_pool *tp);
|
extern aio *create_simulated_aio(thread_pool *tp);
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
|
||||||
/*
|
|
||||||
This function is useful for debugging to make sure all mutexes are released
|
|
||||||
inside a task callback
|
|
||||||
*/
|
|
||||||
void set_after_task_callback(callback_func_np cb);
|
|
||||||
void execute_after_task_callback();
|
|
||||||
#define dbug_execute_after_task_callback() execute_after_task_callback()
|
|
||||||
#else
|
|
||||||
#define dbug_execute_after_task_callback() do{}while(0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class thread_pool
|
class thread_pool
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2019, 2020, MariaDB Corporation.
|
/* Copyright (C) 2019, 2021, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute itand /or modify
|
This program is free software; you can redistribute itand /or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -311,7 +311,6 @@ public:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_callback(m_data);
|
m_callback(m_data);
|
||||||
dbug_execute_after_task_callback();
|
|
||||||
m_running = false;
|
m_running = false;
|
||||||
|
|
||||||
if (m_pool && m_period)
|
if (m_pool && m_period)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright(C) 2019 MariaDB
|
/* Copyright (C) 2019, 2021, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute itand /or modify
|
This program is free software; you can redistribute itand /or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -93,7 +93,6 @@ class thread_pool_win : public thread_pool
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
timer->m_func(timer->m_data);
|
timer->m_func(timer->m_data);
|
||||||
dbug_execute_after_task_callback();
|
|
||||||
if (timer->m_period)
|
if (timer->m_period)
|
||||||
timer->set_time(timer->m_period, timer->m_period);
|
timer->set_time(timer->m_period, timer->m_period);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user