#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2008 Doug Hellmann All rights reserved. # """Normal locks cannot be acquired more than once, even by the same thread """ #end_pymotw_header import threading lock = threading.Lock() print 'First try :', lock.acquire() print 'Second try:', lock.acquire(0)