8010151: nsk/regression/b6653214 fails "assert(snapshot != NULL) failed: Worker should not be started"

Fixed a racing condition when shutting down NMT while worker thread is being started, also fixed a few mis-declared volatile pointers.

Reviewed-by: dholmes, dlong
This commit is contained in:
Zhengyu Gu 2013-04-10 08:55:50 -04:00
parent be10521e31
commit 37fe1421a8
5 changed files with 27 additions and 26 deletions

View file

@ -1056,11 +1056,11 @@ class JavaThread: public Thread {
#if INCLUDE_NMT
// native memory tracking
inline MemRecorder* get_recorder() const { return (MemRecorder*)_recorder; }
inline void set_recorder(MemRecorder* rc) { _recorder = (volatile MemRecorder*)rc; }
inline void set_recorder(MemRecorder* rc) { _recorder = rc; }
private:
// per-thread memory recorder
volatile MemRecorder* _recorder;
MemRecorder* volatile _recorder;
#endif // INCLUDE_NMT
// Suspend/resume support for JavaThread