第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

Thread.activeCount()運(yùn)行出錯(cuò)問(wèn)題

......

? ? System.out.println(Thread.activeCount());

? ? while (Thread.activeCount() > 1) {

? ? ? Thread.yield();

? ? }


? ? System.out.println(t.getNum());

按照教程中寫的代碼

打印結(jié)果:

877

1000

FATAL ERROR in native method: JDWP cannot get thread local storage, jvmtiError=JVMTI_ERROR_WRONG_PHASE(112)

JDWP exit error JVMTI_ERROR_WRONG_PHASE(112): cannot get thread local storage [../../../src/share/back/threadControl.c:195]


為什么有警告輸出?


正在回答

1 回答

你代碼寫錯(cuò)了哦,while(Thread.activeCount() < 1),是活躍的線程數(shù)量小于1,你寫成大于號(hào)啦

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

qq_MrmOnkEy_03331110

沒(méi)有錯(cuò)?。。?! 那個(gè)while循環(huán)所表達(dá)的意思是,當(dāng)活躍的線程大于1時(shí),main線程就先yield 等待,讓上面的其它線程執(zhí)行完畢之后,Thread.activeCount() = 1時(shí),跳出while循環(huán),輸出結(jié)果
2016-05-09 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

Thread.activeCount()運(yùn)行出錯(cuò)問(wèn)題

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)