code: def _get_queue_lock(self, queue, log):
          
          max_workers = self.max_workers_per_queue
  
          # Check if this is single worker queue
          for part in dotted_parts(queue):
              if part in self.single_worker_queues:
                  log.debug('single worker queue')
                  max_workers = 1
                  break
  
          # Max worker queues require us to get a queue lock before
          # moving tasks
          if max_workers:
              queue_lock = Semaphore(self.connection,
                                     self._key(LOCK_REDIS_KEY, queue),
                                     self.id, max_locks=max_workers,
                                     timeout=self.config['ACTIVE_TASK_UPDATE_TIMEOUT'])
              acquired, locks = queue_lock.acquire()
              if not acquired:
                  return None, True
              log.debug('acquired queue lock', locks=locks)
          else:
              queue_lock = None
  
          return queue_lock, False
docs: Get queue lock for max worker queues.
  
          For max worker queues it returns a Lock if acquired and whether
          it failed to acquire the lock.