ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/Queue/Producer.java
(Generate patch)

Comparing experimental/server/Queue/Producer.java (file contents):
Revision 1.1 by tdb, Thu Dec 28 01:01:15 2000 UTC vs.
Revision 1.2 by tdb, Thu Dec 28 03:49:42 2000 UTC

# Line 1 | Line 1
1   class Producer extends Thread {
2      
3 <    public Producer(Queue queue) {
3 >    public Producer(Queue queue, long sleepTime) {
4          _queue = queue;
5 +        _sleepTime = sleepTime;
6      }
7      
8      public void run() {
9          int count = 0;
10          while(true) {
11 <            try { Thread.sleep(1000); } catch(Exception e) {}
11 >            try { Thread.sleep(_sleepTime); } catch(Exception e) {}
12              _queue.add("Object number "+count);
13              count ++;
14              if(count % 10 == 0) {
# Line 17 | Line 18 | class Producer extends Thread {
18      }
19      
20      private Queue _queue;
21 +    private long _sleepTime;
22      
23   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines