~vkolesnikov/pbxt/pbxt-07-low-disk-index-flush

« back to all changes in this revision

Viewing changes to src/thread_xt.cc

  • Committer: Paul McCullagh
  • Date: 2009-03-31 12:53:22 UTC
  • mfrom: (538.1.4 pbms-fixes)
  • Revision ID: paul.mccullagh@primebase.org-20090331125322-089la8tznk63fy9s
Merged RN233

Show diffs side-by-side

added added

removed removed

Lines of Context:
1406
1406
        /* Note, if I move this before thr_exit() then self = xt_get_self(); will fail in 
1407
1407
         * xt_close_file_ns() which is called by xt_unuse_database()!
1408
1408
         */
1409
 
        if (thr_key) {
 
1409
 
 
1410
         /*
 
1411
          * Do not clear the pthread's key value unless it is the same as the thread just released.
 
1412
          * This can happen during shutdown when the engine is deregistered with the PBMS engine.
 
1413
          *
 
1414
          * What happens is that during deregistration the PBMS engine calls close to close all
 
1415
          * PBXT resources on all MySQL THDs created by PBMS for it's own pthreads. So the 'self' 
 
1416
          * being freed is not the same 'self' associated with the PBXT 'thr_key'.
 
1417
          */
 
1418
        if (thr_key && (self == ((XTThreadPtr) xt_get_key(thr_key)))) {
1410
1419
                xt_set_key(thr_key, NULL, NULL);
1411
1420
        }
1412
1421
        xt_free_ns(self);