Example #1
0
def lector(partido, name):

    llave_Lector = RWLock()

    while True:
        llave_Lector.r_acquire()
        try:
            logging.info(
                '%s', name +
                ':  El resultado fue: {0[0]} {0[1]} - {0[2]} {0[3]} '.format(
                    random.choice(partido)))
        finally:
            #time.sleep(random.randint(1,2))
            llave_Lector.r_release()
            time.sleep(random.randint(1, 2))