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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何聲明runtime.LockOSThread()和runtime.

如何聲明runtime.LockOSThread()和runtime.

Go
浮云間 2021-04-27 13:45:58
我找不到如何聲明runtime.LockOSThread()和runtime.UnlockOSThread()的方法。我像[runtime.LockOSThread()]那樣定義一些代碼[runtime.UnlockOSThread()]。但是它給出了錯(cuò)誤,未定義:runtime.LockOSThread和未定義:runtime.UnlockOSThread。有人可以建議我如何定義它嗎?對(duì)于更多,我將其定義為Routine 1 {runtime.LockOSThread()do somethingruntime.UnlockOSThread}main {routine1}
查看完整描述

2 回答

?
慕工程0101907

TA貢獻(xiàn)1887條經(jīng)驗(yàn) 獲得超5個(gè)贊

例如,


package main


import "runtime"


func routine() {

    runtime.LockOSThread()

    runtime.UnlockOSThread()

}


func main() {

    go routine()

}


查看完整回答
反對(duì) 回復(fù) 2021-05-10
?
繁花不似錦

TA貢獻(xiàn)1851條經(jīng)驗(yàn) 獲得超4個(gè)贊

如有疑問(wèn),請(qǐng)參閱文檔。


func LockOSThread()


LockOSThread wires the calling goroutine to its current operating system thread.

Until the calling goroutine exits or calls UnlockOSThread, it will always execute in

that thread, and no other goroutine can.


func UnlockOSThread()


UnlockOSThread unwires the calling goroutine from its fixed operating system thread.

If the calling goroutine has not called LockOSThread, UnlockOSThread is a no-op.


查看完整回答
反對(duì) 回復(fù) 2021-05-10
  • 2 回答
  • 0 關(guān)注
  • 308 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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