| 468 | */ |
| 469 | extern "C" |
| 470 | void thd_set_ha_data(THD *thd, const struct transaction_participant *hton, |
| 471 | const void *ha_data) |
| 472 | { |
| 473 | plugin_ref *lock= &thd->ha_data[hton->slot].lock; |
| 474 | mysql_mutex_lock(&thd->LOCK_thd_data); |
| 475 | thd->ha_data[hton->slot].ha_ptr= const_cast<void*>(ha_data); |
| 476 | mysql_mutex_unlock(&thd->LOCK_thd_data); |
| 477 | if (ha_data && !*lock) |
| 478 | *lock= ha_lock_engine(NULL, (handlerton*) hton); |
| 479 | else if (!ha_data && *lock) |
| 480 | { |
| 481 | plugin_unlock(NULL, *lock); |
| 482 | *lock= NULL; |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | |
| 487 | /** |
no test coverage detected