会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
圣诞。
博客园
首页
新随笔
联系
订阅
管理
随笔分类 -
线程同步概念
多线程同步 锁的概念
摘要:``` import time import threading num = 0 #定义一个全局变量 tolock = threading.Lock() # 创建一把锁 class Mythread(threading.Thread): #继承threading模块的Thread方法 def run(self): #对父类重写 global num #声名修改全局变量 aa=tolock.acqu
阅读全文
posted @
2020-03-14 14:35
酷爱。
阅读(176)
评论(0)
推荐(0)
公告