Attach/associate the connection with the OS thread, */
| 192 | Attach/associate the connection with the OS thread, |
| 193 | */ |
| 194 | static void thread_attach(THD* thd) |
| 195 | { |
| 196 | #ifdef WITH_WSREP |
| 197 | /* Wait until possible background rollback has finished before |
| 198 | attaching the thd. */ |
| 199 | wsrep_wait_rollback_complete_and_acquire_ownership(thd); |
| 200 | #endif /* WITH_WSREP */ |
| 201 | set_mysys_var(thd->mysys_var); |
| 202 | const OS_thread_info *tinfo= get_os_thread_info(); |
| 203 | |
| 204 | set_current_thd(thd); |
| 205 | thd->thread_stack= tinfo->stack_start; |
| 206 | thd->mysys_var->stack_ends_here= tinfo->stack_end; |
| 207 | thd->real_id= tinfo->self; |
| 208 | thd->os_thread_id= tinfo->thread_id; |
| 209 | PSI_CALL_set_thread(thd->get_psi()); |
| 210 | } |
| 211 | |
| 212 | /* |
| 213 | Determine connection priority , using current |
no test coverage detected