/[classpath]/classpath/java/awt/MediaTracker.java
ViewVC logotype

Diff of /classpath/java/awt/MediaTracker.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by rabbit78, Mon Apr 11 07:42:37 2005 UTC revision 1.12 by rabbit78, Tue Apr 12 19:48:43 2005 UTC
# Line 171  public class MediaTracker implements jav Line 171  public class MediaTracker implements jav
171      MediaEntry e = new MediaEntry();      MediaEntry e = new MediaEntry();
172      e.id = id;      e.id = id;
173      e.image = image;      e.image = image;
174      e.next = head;      synchronized(this)
175      head = e;        {
176            e.next = head;
177            head = e;
178          }
179      // Start tracking image status.      // Start tracking image status.
180      int flags = target.checkImage(image, e);      int flags = target.checkImage(image, e);
181      e.imageUpdate(image, flags, -1, -1, -1, -1);      e.imageUpdate(image, flags, -1, -1, -1, -1);
# Line 193  public class MediaTracker implements jav Line 196  public class MediaTracker implements jav
196      MediaEntry e = new MediaEntry();      MediaEntry e = new MediaEntry();
197      e.id = id;      e.id = id;
198      e.image = image;      e.image = image;
     e.next = head;  
199      e.width = width;      e.width = width;
200      e.height = height;      e.height = height;
201      head = e;      synchronized(this)
202          {
203            e.next = head;
204            head = e;
205          }
206      // Start tracking image status.      // Start tracking image status.
207      int flags = target.checkImage(image, width, height, e);      int flags = target.checkImage(image, width, height, e);
208      e.imageUpdate(image, flags, -1, -1, width, height);      e.imageUpdate(image, flags, -1, -1, width, height);
# Line 347  public class MediaTracker implements jav Line 353  public class MediaTracker implements jav
353          {          {
354            wait(ms);            wait(ms);
355            result = checkAll(true);            result = checkAll(true);
356            if ((System.currentTimeMillis() - start) < ms)            if ((System.currentTimeMillis() - start) > ms)
357              break;              break;
358          }          }
359      }      }
# Line 532  public class MediaTracker implements jav Line 538  public class MediaTracker implements jav
538          {          {
539            wait(ms);            wait(ms);
540            result = checkID(id, true);            result = checkID(id, true);
541            if ((System.currentTimeMillis() - start) < ms)            if ((System.currentTimeMillis() - start) > ms)
542              break;              break;
543          }          }
544      }      }
# Line 579  public class MediaTracker implements jav Line 585  public class MediaTracker implements jav
585     */     */
586    public void removeImage(Image image)    public void removeImage(Image image)
587    {    {
588      MediaEntry e = head;      synchronized (this)
     MediaEntry prev = null;  
     while (e != null)  
589        {        {
590          if (e.image == image)          MediaEntry e = head;
591            {          MediaEntry prev = null;
592              if (prev == null)          while (e != null)
593                head = e.next;            {
594              else              if (e.image == image)
595                prev.next = e.next;                {
596            }                  if (prev == null)
597          prev = e;                    head = e.next;
598          e = e.next;                  else
599                      prev.next = e.next;
600                  }
601                prev = e;
602                e = e.next;
603              }
604        }        }
605    }    }
606    
# Line 602  public class MediaTracker implements jav Line 611  public class MediaTracker implements jav
611     */     */
612    public void removeImage(Image image, int id)    public void removeImage(Image image, int id)
613    {    {
614      MediaEntry e = head;      synchronized (this)
     MediaEntry prev = null;  
     while (e != null)  
615        {        {
616          if (e.id == id && e.image == image)          MediaEntry e = head;
617            {          MediaEntry prev = null;
618              if (prev == null)          while (e != null)
619                head = e.next;            {
620              else              if (e.id == id && e.image == image)
621                prev.next = e.next;                {
622            }                  if (prev == null)
623          else                    head = e.next;
624            prev = e;                  else
625          e = e.next;                    prev.next = e.next;
626        }                  }
627                else
628                  prev = e;
629                e = e.next;
630              }
631          }
632    }    }
633    
634    /**    /**
# Line 626  public class MediaTracker implements jav Line 638  public class MediaTracker implements jav
638     */     */
639    public void removeImage(Image image, int id, int width, int height)    public void removeImage(Image image, int id, int width, int height)
640    {    {
641      MediaEntry e = head;      synchronized (this)
     MediaEntry prev = null;  
     while (e != null)  
642        {        {
643          if (e.id == id && e.image == image          MediaEntry e = head;
644              && e.width == width && e.height == height)          MediaEntry prev = null;
645            {          while (e != null)
646              if (prev == null)            {
647                head = e.next;              if (e.id == id && e.image == image
648              else                  && e.width == width && e.height == height)
649                prev.next = e.next;                {
650            }                  if (prev == null)
651          else                    head = e.next;
652            prev = e;                  else
653          e = e.next;                    prev.next = e.next;
654                  }
655                else
656                  prev = e;
657                e = e.next;
658              }
659        }        }
660    }    }
661  }  }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26