public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <bug-21524-8172@http.gcc.gnu.org/bugzilla/>]
* [Bug java/21524] New: Cancelling a TimerTask puts Timer binary heap in inconsistent state
@ 2005-05-11 23:38 jradel at 2wire dot com
  2005-05-11 23:43 ` [Bug libgcj/21524] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: jradel at 2wire dot com @ 2005-05-11 23:38 UTC (permalink / raw)
  To: java-prs

java/util/Timer uses a binary heap for its TimerTasks, using task.scheduled as
the key. Calling task.cancel() sets task.scheduled=-1, but doesn't update the
Timer binary heap. This can leave the binary heap in an inconsistent state --
the key shouldn't be modified while the task is in the binary heap. This can
lead to situations where newly scheduled TimerTasks aren't moved to the
appropriate position in the heap, so tasks might fire late (since they are stuck
behind tasks that aren't scheduled to fire for a while).

Attaching a proposed fix.

-- 
           Summary: Cancelling a TimerTask puts Timer binary heap in
                    inconsistent state
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jradel at 2wire dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21524


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-11 14:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21524-10617@http.gcc.gnu.org/bugzilla/>
2006-06-21 20:09 ` [Bug libgcj/21524] Cancelling a TimerTask puts Timer binary heap in inconsistent state tromey at gcc dot gnu dot org
     [not found] <bug-21524-8172@http.gcc.gnu.org/bugzilla/>
2012-01-11 14:04 ` rguenth at gcc dot gnu.org
2005-05-11 23:38 [Bug java/21524] New: " jradel at 2wire dot com
2005-05-11 23:43 ` [Bug libgcj/21524] " pinskia at gcc dot gnu dot org
2005-05-12 18:32 ` jradel at 2wire dot com
2005-05-13 16:30 ` tromey at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).