| 46 | static struct handler_cb *cb_list; // protected by LOCK_manager |
| 47 | |
| 48 | bool 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 | |
| 72 | pthread_handler_t handle_manager(void *arg __attribute__((unused))) |
| 73 | { |
no test coverage detected