.class public ConsumeIntegerSync

.super java/lang/Thread

.field private protected cHold LHoldIntegerSync;
.field private protected f Ljoos/lib/JoosIO;

.method public <init>(LHoldIntegerSync;)V
  .limit locals 2
  .limit stack 3
  aload_0
  aconst_null
  checkcast java/lang/Thread
  invokenonvirtual java/lang/Thread/<init>(Ljava/lang/Runnable;)V
  aload_0
  aload_1
  putfield ConsumeIntegerSync/cHold LHoldIntegerSync;
  new joos/lib/JoosIO
  dup
  invokenonvirtual joos/lib/JoosIO/<init>()V
  aload_0
  swap
  putfield ConsumeIntegerSync/f Ljoos/lib/JoosIO;
  return
.end method

.method public run()V
  .limit locals 3
  .limit stack 5
  aload_0
  getfield ConsumeIntegerSync/cHold LHoldIntegerSync;
  invokevirtual HoldIntegerSync/getSharedInt()I
  istore_1
  aload_0
  getfield ConsumeIntegerSync/f Ljoos/lib/JoosIO;
  ldc "Consumer retrieved "
  new java/lang/Integer
  dup
  iload_1
  invokenonvirtual java/lang/Integer/<init>(I)V
  invokevirtual java/lang/Integer/toString()Ljava/lang/String;
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual joos/lib/JoosIO/println(Ljava/lang/String;)V
  start_4:
  iload_1
  ldc 9
  if_icmpeq stop_5
  new java/util/Random
  dup
  invokenonvirtual java/util/Random/<init>()V
  invokevirtual java/util/Random/nextInt()I
  istore_2
  iload_2
  iconst_0
  if_icmpge stop_8
  iload_2
  ineg
  istore_2
  stop_8:
  new joos/lib/JoosThread
  dup
  aconst_null
  invokenonvirtual joos/lib/JoosThread/<init>(Ljava/lang/Thread;)V
  iload_2
  ldc 3000
  irem
  invokevirtual joos/lib/JoosThread/sleep(I)Z
  ifeq stop_11
  aload_0
  getfield ConsumeIntegerSync/f Ljoos/lib/JoosIO;
  ldc "Interruption of thread "
  aload_0
  invokevirtual java/lang/Thread/getName()Ljava/lang/String;
  dup
  ifnonnull stop_17
  pop
  ldc "null"
  stop_17:
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  dup
  ifnonnull stop_13
  pop
  ldc "null"
  stop_13:
  ldc "."
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual joos/lib/JoosIO/println(Ljava/lang/String;)V
  stop_11:
  aload_0
  getfield ConsumeIntegerSync/cHold LHoldIntegerSync;
  invokevirtual HoldIntegerSync/getSharedInt()I
  istore_1
  aload_0
  getfield ConsumeIntegerSync/f Ljoos/lib/JoosIO;
  ldc "Consumer retrieved "
  new java/lang/Integer
  dup
  iload_1
  invokenonvirtual java/lang/Integer/<init>(I)V
  invokevirtual java/lang/Integer/toString()Ljava/lang/String;
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual joos/lib/JoosIO/println(Ljava/lang/String;)V
  goto start_4
  stop_5:
  return
.end method

