.class public ProduceInteger

.super java/lang/Thread

.field private protected pHold LHoldInteger;
.field private protected f Ljoos/lib/JoosIO;

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

.method public run()V
  .limit locals 3
  .limit stack 5
  iconst_0
  istore_1
  start_0:
  iload_1
  ldc 10
  if_icmpge stop_1
  aload_0
  getfield ProduceInteger/pHold LHoldInteger;
  iload_1
  invokevirtual HoldInteger/setSharedInt(I)V
  aload_0
  getfield ProduceInteger/f Ljoos/lib/JoosIO;
  ldc "Producer set sharedInt to "
  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
  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 ProduceInteger/f Ljoos/lib/JoosIO;
  ldc "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 "interrupted."
  invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
  invokevirtual joos/lib/JoosIO/println(Ljava/lang/String;)V
  stop_11:
  iinc 1 1
  goto start_0
  stop_1:
  return
.end method

