Commit 29248787 authored by Rich Prohaska's avatar Rich Prohaska

#141 fix another open close race

parent 1940f717
......@@ -308,6 +308,8 @@ static int free_share(TOKUDB_SHARE * share) {
if (error) {
result = error;
}
if (share->key_file[i] == share->file)
share->file = NULL;
share->key_file[i] = NULL;
}
}
......@@ -321,7 +323,6 @@ static int free_share(TOKUDB_SHARE * share) {
tokudb_pthread_mutex_lock(&share->mutex);
share->m_state = TOKUDB_SHARE::CLOSED;
if (share->use_count > 0) {
fprintf(stderr, "%ld %s:%u free_share %p %d\n", syscall(186), __FILE__, __LINE__, share, share->use_count);
tokudb_pthread_cond_broadcast(&share->m_openclose_cond);
tokudb_pthread_mutex_unlock(&share->mutex);
tokudb_pthread_mutex_unlock(&tokudb_mutex);
......@@ -1600,6 +1601,7 @@ int ha_tokudb::initialize_share(
}
DBUG_PRINT("info", ("share->use_count %u", share->use_count));
share->m_initialize_count++;
error = get_status(txn);
if (error) {
......
......@@ -192,6 +192,7 @@ class TOKUDB_SHARE {
pthread_cond_t m_openclose_cond;
enum { CLOSED, OPENING, OPENED, CLOSING, ERROR } m_state;
int m_error;
int m_initialize_count;
};
typedef struct st_filter_key_part_info {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment