MCPcopy Create free account
hub / github.com/TechXueXi/TechXueXi / MyThread

Class MyThread

SourcePackages/pdlearn/threads.py:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29class MyThread(Thread):
30 def __init__(self, name, func, *args, lock=False):
31 Thread.__init__(self)
32 self.name = name
33 self.func = func
34 self.args = args
35 self.lock = lock
36
37 def run(self):
38 print("开启: " + self.name)
39 if self.lock:
40 threadLock.acquire()
41 self.func(*self.args)
42 threadLock.release()
43 else:
44 self.func(*self.args)

Callers 1

weixinInterfaceFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected