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

Function thread_attach

sql/threadpool_common.cc:194–210  ·  view source on GitHub ↗

Attach/associate the connection with the OS thread, */

Source from the content-addressed store, hash-verified

192 Attach/associate the connection with the OS thread,
193*/
194static 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

Callers 3

Calls 5

set_mysys_varFunction · 0.85
get_os_thread_infoFunction · 0.85
set_current_thdFunction · 0.85
get_psiMethod · 0.80

Tested by

no test coverage detected