What does "0xDEAD" mean in the following code?

There is an enumeration structure, but I do not understand the meaning of "0xDEAD - 2" in this enumeration.

enum TerminatedTypes {
    _not_terminated = 0xDEAD - 2,
    _thread_exiting,                            
    _thread_terminated,                          
    _vm_exited                                   
};

From the code above What benefits can I get?

The code above is in 'hotspot / src / share / vm / runtime / thread.hpp' in openjdk8.

I am studying jdk source code, please help me.

+4
source share
1 answer

This is a hex literal that is used as an eyecatcher (useful in debuggers), so the value _thread_terminatedwill be 0xDEAD("complete thread" equals "dead").

- , DEADBEEF from ..

+9

All Articles