def acquire_reader(self):
        """
        Acquire a read lock, several threads can hold this type of lock.
        """
        with self.mutex:
            while self.rwlock < 0 or self.rwlock == self.max_reader_concurrency or self.writers_waiting:
                self.readers_ok.wait()
            self.rwlock += 1
def acquire_reader ( self ) : with self . mutex : while self . rwlock < 0 or self . rwlock == self . max_reader_concurrency or self . writers_waiting : self . readers_ok . wait ( ) self . rwlock += 1
Acquire a read lock, several threads can hold this type of lock.