首先,我是python多线程的新手。我有一个程序,检测手的照片集使用多个并行线程和检测后,主程序做一些功能的基础上,手检测图像。函数在主线程上。但是现在这两个函数和手检测线程都是并行运行的。我需要暂停主线程,直到完成手检测线程的执行。对不起,我的语言错误
#Thread creation function
def callThreads(self, imageLst):
global taskLock, tasks
for tid in range(1, 10, 1): ## 1,11,1
thread = handdetect.detectHandThread(imageLst, tid, 'thread_{}'.format(tid), tasks, taskLock,
obj_detection_graph_queue, obj_detLock)
thread.start()
threads.append(thread)
print("[INFO] Thread {} created and added to the pool...".format(tid))
# main() function of the programme
..............
self.callThreads(filenames)
Some functions()
............
在维护列表} :
threads
时,只需对其所有元素调用^{相关问题 更多 >
编程相关推荐