def __init__(self, maxsize=0, priorities = standard_priorities, realtime = 1, idle = 1):
        """Initialize a queue object with a given maximum size.

        If maxsize is <= 0, the queue size is infinite.
        priorities: a dictionary with definition of priorities
        """
        assert self._check_priorities(priorities)       #check only if not -OO
        import thread
        self._init(priorities, maxsize, realtime, idle)
        self.mutex = thread.allocate_lock()
        self.esema = thread.allocate_lock()
        self.esema.acquire()
        self.fsema = thread.allocate_lock()
Initialize a queue object with a given maximum size.

        If maxsize is <= 0, the queue size is infinite.
        priorities: a dictionary with definition of priorities
        
recipes/Python/87707_Scheduled_Queue/recipe-87707.py