Fix a prof_tctx_t/prof_tdata_t cleanup race.

Fix a prof_tctx_t/prof_tdata_t cleanup race by storing a copy of thr_uid
in prof_tctx_t, so that the associated tdata need not be present during
tctx teardown.
This commit is contained in:
Jason Evans
2014-10-12 13:03:20 -07:00
parent 381c23dd9d
commit 44c97b712e
2 changed files with 11 additions and 5 deletions

View File

@@ -89,6 +89,12 @@ struct prof_tctx_s {
/* Thread data for thread that performed the allocation. */
prof_tdata_t *tdata;
/*
* Copy of tdata->thr_uid, necessary because tdata may be defunct during
* teardown.
*/
uint64_t thr_uid;
/* Profiling counters, protected by tdata->lock. */
prof_cnt_t cnts;