MCPcopy Create free account
hub / github.com/MariaDB/server / mysql_manager_submit

Function mysql_manager_submit

sql/sql_manager.cc:48–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46static struct handler_cb *cb_list; // protected by LOCK_manager
47
48bool mysql_manager_submit(void (*action)(void *), void *data)
49{
50 bool result= FALSE;
51 DBUG_ASSERT(manager_thread_in_use == 1);
52 struct handler_cb **cb;
53 mysql_mutex_lock(&LOCK_manager);
54 cb= &cb_list;
55 while (*cb)
56 cb= &(*cb)->next;
57 *cb= (struct handler_cb *)my_malloc(PSI_INSTRUMENT_ME,
58 sizeof(struct handler_cb), MYF(MY_WME));
59 if (!*cb)
60 result= TRUE;
61 else
62 {
63 (*cb)->next= NULL;
64 (*cb)->action= action;
65 (*cb)->data= data;
66 }
67 mysql_cond_signal(&COND_manager);
68 mysql_mutex_unlock(&LOCK_manager);
69 return result;
70}
71
72pthread_handler_t handle_manager(void *arg __attribute__((unused)))
73{

Calls 1

my_mallocFunction · 0.85

Tested by

no test coverage detected