21 #include "sql_class.h"
25 : global_lock(_global_lock)
27 DBUG_ENTER(
"Mutex_cond_array::Mutex_cond_array");
28 my_init_dynamic_array(&array,
sizeof(Mutex_cond *), 0, 8);
35 DBUG_ENTER(
"Mutex_cond_array::~Mutex_cond_array");
41 for (
int i= 0;
i <= max_index;
i++)
43 Mutex_cond *mutex_cond= get_mutex_cond(
i);
51 delete_dynamic(&array);
60 DBUG_ENTER(
"Mutex_cond_array::enter_cond");
61 Mutex_cond *mutex_cond= get_mutex_cond(n);
62 thd->ENTER_COND(&mutex_cond->cond, &mutex_cond->mutex, stage, old_stage);
69 DBUG_ENTER(
"Mutex_cond_array::ensure_index");
76 if (allocate_dynamic(&array, n + 1))
78 for (
int i= max_index + 1;
i <=
n;
i++)
80 Mutex_cond *mutex_cond= (Mutex_cond *)my_malloc(
sizeof(Mutex_cond), MYF(MY_WME));
81 if (mutex_cond == NULL)
85 insert_dynamic(&array, &mutex_cond);
86 DBUG_ASSERT(&get_mutex_cond(
i)->mutex == &mutex_cond->mutex);
92 BINLOG_ERROR((
"Out of memory."), (ER_OUT_OF_RESOURCES, MYF(0)));
93 RETURN_REPORTED_ERROR;