yar999
Go语言圣经

Updated 2 years ago

AlienF (@alienf) started discussion #42

8 months ago · 0 comments

Open

然后主函数返回。主函数返回时,所有的goroutine都会被直接打断,程序退出。除了从主函数退出或者直接终止程序之外,没有其它的编程方法能够让一个goroutine来打断另一个的执行,但是之后可以看到一种方式来实现这个目的,通过goroutine之间的通信来让一个goroutine请求其它的goroutine,并被请求的goroutine自行结束执行。

Goroutines (Edit this file)

主函数返回时,主函数中创建的goroutine都会退出。

No description provided.

No comments on this discussion.


to join this conversation on GitBook. Already have an account? Sign in to comment
Notifications

You’re not receiving notifications from this thread.


1 participant