Preventing tread collisions

MRAB python at mrabarnett.plus.com
Wed Dec 12 16:13:34 EST 2012


On 2012-12-12 20:58, Ian Kelly wrote:
> On Wed, Dec 12, 2012 at 1:53 PM, MRAB <python at mrabarnett.plus.com> wrote:
>> You could try a non-blocking semaphore:
>>
>> def __init__(self):
>>     self.cameraActive = Semaphore()
>
> Why a Semaphore and not just a plain old Lock?
>
Good point. I probably thought of a semaphore because the OP mentioned
it first. :-)



More information about the Python-list mailing list