package com.google.android.m4b.maps.a;

import android.os.Process;
import java.util.concurrent.BlockingQueue;

public final class c extends Thread
{
  private static final boolean a = s.a;
  private final BlockingQueue<k> b;
  private final BlockingQueue<k> c;
  private final b d;
  private final n e;
  private volatile boolean f = false;

  public c(BlockingQueue<k> paramBlockingQueue1, BlockingQueue<k> paramBlockingQueue2, b paramb, n paramn)
  {
    this.b = paramBlockingQueue1;
    this.c = paramBlockingQueue2;
    this.d = paramb;
    this.e = paramn;
  }

  public final void a()
  {
    this.f = true;
    interrupt();
  }

  public final void run()
  {
    if (a)
      s.a("start new dispatcher", new Object[0]);
    Process.setThreadPriority(10);
    this.d.a();
    final k localk;
    label73: b.a locala;
    int i;
    while (true)
    {
      try
      {
        localk = (k)this.b.take();
        localk.a("cache-queue-take");
        if (!localk.g())
          break label73;
        localk.b("cache-discard-canceled");
        continue;
      }
      catch (InterruptedException localInterruptedException)
      {
      }
      if (this.f)
      {
        return;
        locala = this.d.a(localk.d());
        if (locala == null)
        {
          localk.a("cache-miss");
          this.c.put(localk);
        }
        else
        {
          if (locala.d >= System.currentTimeMillis())
            break label261;
          i = 1;
          label124: if (i == 0)
            break;
          localk.a("cache-hit-expired");
          localk.a(locala);
          this.c.put(localk);
        }
      }
    }
    localk.a("cache-hit");
    m localm = localk.a(new h(locala.a, locala.f));
    localk.a("cache-hit-parsed");
    if (locala.e < System.currentTimeMillis());
    for (int j = 1; ; j = 0)
    {
      if (j == 0)
      {
        this.e.a(localk, localm);
        break;
      }
      localk.a("cache-hit-refresh-needed");
      localk.a(locala);
      localm.d = true;
      this.e.a(localk, localm, new Runnable()
      {
        public final void run()
        {
          try
          {
            c.a(c.this).put(localk);
            return;
          }
          catch (InterruptedException localInterruptedException)
          {
          }
        }
      });
      break;
      label261: i = 0;
      break label124;
    }
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.a.c
 * JD-Core Version:    0.6.2
 */