add function sf_notify_all_threads_ex

storage_pool
YuQing 2021-04-09 21:26:57 +08:00
parent f563bb17ef
commit 68db56790c
2 changed files with 18 additions and 0 deletions

View File

@ -678,6 +678,17 @@ struct nio_thread_data *sf_get_random_thread_data_ex(SFContext *sf_context)
return sf_context->thread_data + index;
}
void sf_notify_all_threads_ex(SFContext *sf_context)
{
struct nio_thread_data *tdata;
struct nio_thread_data *tend;
tend = sf_context->thread_data + sf_context->work_threads;
for (tdata=sf_context->thread_data; tdata<tend; tdata++) {
ioevent_notify_thread(tdata);
}
}
void sf_set_sig_quit_handler(sf_sig_quit_handler quit_handler)
{
sig_quit_handler = quit_handler;

View File

@ -105,6 +105,13 @@ struct nio_thread_data *sf_get_random_thread_data_ex(SFContext *sf_context);
#define sf_get_random_thread_data() \
sf_get_random_thread_data_ex(&g_sf_context)
void sf_notify_all_threads_ex(SFContext *sf_context);
#define sf_notify_all_threads() \
sf_notify_all_threads_ex(&g_sf_context)
void sf_set_sig_quit_handler(sf_sig_quit_handler quit_handler);
int sf_init_task(struct fast_task_info *task);