以下代码中的“0xDEAD”是什么意思? [英] What does '0xDEAD' mean in the following code?

查看:520
本文介绍了以下代码中的“0xDEAD”是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个枚举结构,但是我不明白这个枚举中'0xDEAD - 2'的含义。

There is an enum structure,but I don't understand the meaning of '0xDEAD - 2' in this enum.

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

从上面的代码可以得到什么样的好处?

From the code above,What kind of benefit can I get?

上面的代码在openjdk8中的'hotspot / src / share / vm / runtime / thread.hpp'中。

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

我正在学习源代码的jdk,请帮助我。

I am studying source code of jdk,please help me.

推荐答案

这是一个十六进制文字,被用作一个eyecatcher(在调试器中有用),以便 _thread_terminated 值将为 0xDEAD (终止的线程等于死)。

It's a hex literal, being used as an eyecatcher (useful in debuggers) so that the _thread_terminated value will be 0xDEAD ("terminated thread" equals "dead").

人们对这样的东西使用了大量的十六进制文字,例如来自 DEADBEEF 术语/ html / D / DEADBEEF.html>术语文件等等。

There's a host of hex literals people use for things like that, such as DEADBEEF from the Jargon file, and so on.

这篇关于以下代码中的“0xDEAD”是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆