python多線程之semaphore(信號量)

#!/usr/bin/env python # -*- coding: utf-8 -*- import threading import time import random semaphore = threading.Semaphore(0) def consumer(): print("consumer is waiting.") semaphore.acquire
相關文章
相關標籤/搜索