~thomir-deactivatedaccount/drizzle/drizzle-fix-bug653747

« back to all changes in this revision

Viewing changes to plugin/innobase/thr/thr0loc.c

  • Committer: Brian Aker
  • Date: 2010-10-10 02:07:52 UTC
  • mfrom: (1827.2.3 staging)
  • Revision ID: brian@tangent.org-20101010020752-ktv73isay5dxtvp3
Merge in switch on table_share_instance inheritance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
246
246
 
247
247
        mutex_create(&thr_local_mutex, SYNC_THR_LOCAL);
248
248
}
249
 
 
250
 
/********************************************************************
251
 
Close the thread local storage module. */
252
 
UNIV_INTERN
253
 
void
254
 
thr_local_close(void)
255
 
/*=================*/
256
 
{
257
 
        ulint           i;
258
 
 
259
 
        ut_a(thr_local_hash != NULL);
260
 
 
261
 
        /* Free the hash elements. We don't remove them from the table
262
 
        because we are going to destroy the table anyway. */
263
 
        for (i = 0; i < hash_get_n_cells(thr_local_hash); i++) {
264
 
                thr_local_t*    local;
265
 
 
266
 
                local = HASH_GET_FIRST(thr_local_hash, i);
267
 
 
268
 
                while (local) {
269
 
                        thr_local_t*    prev_local = local;
270
 
 
271
 
                        local = HASH_GET_NEXT(hash, prev_local);
272
 
                        ut_a(prev_local->magic_n == THR_LOCAL_MAGIC_N);
273
 
                        mem_free(prev_local);
274
 
                }
275
 
        }
276
 
 
277
 
        hash_table_free(thr_local_hash);
278
 
        thr_local_hash = NULL;
279
 
}