common/src/main/java/HTTPClient/StreamDemultiplexor.java
/**
     * This timer is implemented by sleeping for 1 second and then
     * checking the timer list.
     */
This timer is implemented by sleeping for 1 second and then
checking the timer list.
This timer is implemented by sleeping for 1 second and then checking the timer list .
public void run()
    {
	TimeoutEntry marked = null;
	while (alive)
	{
	    try { sleep(1000L); } catch (InterruptedException ie) { }
	    synchronized (time_list)
	    {
		for (TimeoutEntry entry = time_list[current].next;
		     entry != time_list[current];
		     entry = entry.next)
		{
		    entry.restart = false;
		}
		current++;
		if (current >= time_list.length)
		    current = 0;
		for (TimeoutEntry entry = time_list[current].next;
		     entry != time_list[current];
		     entry = entry.next)
		{
		    if (entry.alive  &&  !entry.hyber)
		    {
			TimeoutEntry prev = entry.prev;
			entry.kill();
			/* put on death row. Note: we must not invoke
			 * markForClose() here because it is synch'd
			 * and can therefore lead to a deadlock if that
			 * thread is trying to do a reset() or kill()
			 */
			entry.next = marked;
			marked = entry;
			entry = prev;
		    }
		}
	    }
	    while (marked != null)
	    {
		marked.demux.markForClose(null);
		marked = marked.next;
	    }
	}
    }
public void run ( ) { TimeoutEntry marked = null ; while ( alive ) { try { sleep ( 1000L ) ; } catch ( InterruptedException ie ) { } synchronized ( time_list ) { for ( TimeoutEntry entry = time_list [ current ] . next ; entry != time_list [ current ] ; entry = entry . next ) { entry . restart = false ; } current ++ ; if ( current >= time_list . length ) current = 0 ; for ( TimeoutEntry entry = time_list [ current ] . next ; entry != time_list [ current ] ; entry = entry . next ) { if ( entry . alive && ! entry . hyber ) { TimeoutEntry prev = entry . prev ; entry . kill ( ) ; /* put on death row. Note: we must not invoke
			 * markForClose() here because it is synch'd
			 * and can therefore lead to a deadlock if that
			 * thread is trying to do a reset() or kill()
			 */ entry . next = marked ; marked = entry ; entry = prev ; } } } while ( marked != null ) { marked . demux . markForClose ( null ) ; marked = marked . next ; } } }
This timer is implemented by sleeping for 1 second and then
 checking the timer list.
This timer is implemented by sleeping for 1 second and then checking the timer list .
// reset all restart flags // remove all expired timers 