当前位置:网站首页>Signals
Signals
2022-04-21 07:46:00 【Xiong Xiaohan】
signal.Notify adopt channel Receive signals from the system .
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
done := make(chan bool, 1)
go func() {
sig := <-sigs
fmt.Println()
fmt.Println(sig)
done <- true
}()
fmt.Println("awaiting signal")
<-done
fmt.Println("exiting")
Compile and run the program :
% ./signals
awaiting signal
Interrupt program execution :
^C
interrupt
exiting
版权声明
本文为[Xiong Xiaohan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210627175455.html
边栏推荐
- ReportViewer的RDLC打印报表怎么动态加载参数、图片、背景图
- When deploying. Net core on Linux platform to access SQL Server 2008 R2, it prompts the connection timeout exception
- div点击折叠收缩
- XML encoding and decoding
- 服务器部署svn环境
- Implementation of crud of user management system with JDBC
- H + background UI framework, click the button to create a new tab
- 文件打包下载
- 服务器和客户端的套接字通信
- playwright,selenium,操作ifram元素
猜你喜欢

.net core 部署至Linux平台上访问SQL SERVER 2008 R2时提示连接超时异常

ELK日志分析系统的原理与介绍

Flutter初体验

pip list 中已有的模块为什么没法在新project中使用,已解决

论文阅读:Social Media and Fake News in the 2016 Election

fiddler调换字体后界面缺少 恢复

论文阅读:Security Challenges in an Increasingly Tangled Web

Leetcode 1423.可获得的最大点数(Maximum Points You Can Obtain from Cards)

Steps for umlet beginners

ReportViewer的RDLC打印报表怎么动态加载参数、图片、背景图
随机推荐
sqlserver 两个表之间进行模糊查询,sqlserver 导入excel数据步骤
leetcode 707.设计链表
SMS logic vulnerability
Lecture de l'article: mesurer l'impact d'un accès DDOS réussi sur le comportement du client du serveur DNS géré
在Navicat工具中创建oracle数据库
Exit and Status
虚拟机 主机 ping ssh 校园网 桥接 NET
Time and Duration and Epoch
服务器部署svn环境
三级菜单动态生成
pycharm 最新导入PIL库的方法
文件打包下载
About DM Dameng database, SQL to obtain user table information, data table structure, data table creation statement, primary key and other information
db2相关操作知识点积累及WINDOWS环境DB2连接远程数据库实例
Enterprise service bus -- Introduction to muleesb
Navicat连Oracle报错[No matching authentication protocol]
leetcode 19.删除链表倒数的第N个节点
Command-Line
OmniPlan工具使用手册
Testing and Benchmarking