Why myPid() and myTid() return the same value?

bluecrest bluecrest 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
MessengerServiceActivities.java is the file in android sample.
Locate in C:\android-sdk-windows\samples\android-8\ApiDemos\src\com\example\android\apis\app\ dir.

I add myPid() and myTid() in onCreate(), then i set a breakpoint at code System.out. I find pid and tid are the same value. I know the process id and thread id should not be the same in windows, Why myPid() and myTid() return the same value in android?

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int pid;
int tid;
pid = android.os.Process.myPid();
tid = android.os.Process.myTid();
System.out.println(pid +" "+ tid);

setContentView(R.layout.messenger_service_binding);
...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
bluecrest
Android 80,489 成员 91,375 内容