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

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

為什么我的 go 頻道被屏蔽了?

為什么我的 go 頻道被屏蔽了?

Go
素胚勾勒不出你 2021-07-30 17:04:56
似乎“復(fù)雜”( getC) 函數(shù)被阻塞了。我假設(shè)通道一旦被讀取就會(huì)被銷毀,因此我想知道如何sC與getC函數(shù)和main函數(shù)共享通道而不會(huì)陷入死鎖(當(dāng)前片段)package mainfunc main() {//simple function and complex function/channel    sC := make(chan string)    go getS(sC)    cC := make(chan string)    go getC(sC, cC)//collect the functions result         s := <-sC//do something with `s`. We print but we may want to use it in a `func(s)`print(s)//after a while we do soemthing with `c`        c := <-cC    print(c)}func getS(sC chan string) {    s :=  " simple completed "    sC <- s}func getC(sC chan string, cC chan string) {//we do some complex stuff  print("complex is not complicated\n")//Now  we need the simple value so we try wait for the s channel.    s := <-sC    c := s + " more "    cC <- c //send complex value}
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 196 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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