Did I find the right examples for you? yes no

All Samples(7)  |  Call(3)  |  Derive(0)  |  Import(4)

        def lock():
    global lockCount

    if lockCount > 0:
        # Already locked.
        lockCount += 1
        return True

    if not _aquireLock():

        if config.Config.cron == "1":
            do_output = 0
        else:
            do_output = 2

        if do_output:
            output("waiting for lock ...", nl=False)

        count = 0
        while not _aquireLock():
            if do_output:
                output(".", nl=False)
            time.sleep(1)

            count += 1
            if count > 30:
                output("cannot get lock") # always output this one.
                return False

        if do_output:
            output(" ok")

    lockCount = 1
    return True
        


src/l/u/lusernews-HEAD/src/user.py   lusernews(Download)
        return None, "Username exists, please try a different one."
 
    if not util.lock('create_user.' + username):
        return None, "Please wait some time before creating a new user."
 

src/l/u/lusernews-HEAD/src/github.py   lusernews(Download)
        return None, "Username exists, please try a different one."
 
    if not util.lock('create_user.' + username):
        return None, "Please wait some time before creating a new user."
 

src/b/r/broctl-HEAD/BroControl/cron.py   broctl(Download)
    config.Config.config["cron"] = "1"  # Flag to indicate that we're running from cron.
 
    if not util.lock():
        return
 

src/d/i/digsby-HEAD/digsby/src/jabber/filetransfer/socketserver.py   digsby(Download)
from functools import partial
from threading import RLock
from util import lock, get_ips_s
 
from logging import getLogger

src/d/i/digsby-HEAD/digsby/src/digsby/loginutil.py   digsby(Download)
from common.timeoutsocket import TimeoutSocketMulti
from util import Timer
from util import lock
from traceback import print_exc
 

src/d/i/digsby-HEAD/digsby/src/jabber/disco.py   digsby(Download)
        self.Destroy()
 
from util import lock
 
class DiscoNode(object):

src/d/i/digsby-HEAD/digsby/src/jabber/filetransfer/initiateStream.py   digsby(Download)
 
from path import path
from util import lock
 
done_states  = FileTransfer.states.CompleteStates | FileTransfer.states.FailStates