4 public static int count
= 0;
10 System
.out
.println("PASSED: Sender completed");
21 System
.out
.println("PASSED: Receiver completed");
26 String name
= Thread
.currentThread().getName();
27 if (name
.equals("timer")) {
30 } catch (InterruptedException e
){}
31 System
.out
.println("FAILED: timer triggered");
36 } catch (Exception e
) {
37 System
.out
.println("FAILED: receiver: " + e
);
41 public static void main(String args
[])
48 Thread receiver_thread
= new Thread(receiver
);
50 /* Make sure the test terminates even if it hangs on network */
51 JoinTest timer
= new JoinTest();
52 Thread timer_thread
= new Thread(timer
, "timer");
55 synchronized(receiver
) {
56 receiver_thread
.start();
61 } catch (Exception e
) {
62 System
.out
.println("FAILED: sender: " + e
);
65 receiver_thread
.join();
68 throw new Exception("Nothing received");
70 System
.out
.println("PASSED: Join send/receive count="+count
);
72 } catch (Exception e
) {
73 System
.out
.println("FAILED: " + e
);