Пример #1
0
static void stat_update_persistent_storage( void *ign )
{
    (void) ign;
#if COMPILE_PERSISTENT_STATS
    int i;

    static net_timer_event e;

    {
        int rc = set_net_timer( &e, 10000, stat_update_persistent_storage, 0, 0 );
        if( rc )
            printf( "can't set timer, persistent stats are dead" );
            //SHOW_ERROR0( 0, "can't set timer, persistent stats are dead" );
    }

    //assert(pdata); // TODO check that addr is in persistent area
    if( !pdata )
        return;

    for( i = 0; i < MAX_STAT_COUNTERS; i++ )
    {
        pdata[i].total_prev_and_this_runs =
            pdata[i].total_prev_runs +
            stat_total_counters[i];
    }
#endif
}
Пример #2
0
static void dpc_timer_wake( void *arg )
{
    (void) arg;

    set_net_timer( &dpc_nte, 1000, dpc_timer_wake, 0, 0 );
    dpc_timed();
}
Пример #3
0
int phantom_console_window_putc(int c)
{
#if TIMED_FLUSH
    phantom_undo_timed_call( &cons_timer );
#endif

#if NET_TIMED_FLUSH
    cancel_net_timer(&cons_upd_timer);
#endif

    switch(c)
    {
    case '\b':
        if(cbufpos > 0) cbufpos--;
        goto noflush;
        //return c;

    case '\t':
        while(cbufpos % 8)
        {
            if(cbufpos >= BUFS)
                break;
            put_buf(' ');
        }
        goto noflush;
        //return c;

    case '\n':
    case '\r':
        put_buf( c );
        goto flush;

    default:
        put_buf( c );
        if( cbufpos >= BUFS )
            goto flush;

noflush:
#if TIMED_FLUSH
        phantom_request_timed_call( &cons_timer, 0 );
#endif

#if NET_TIMED_FLUSH
        set_net_timer(&cons_upd_timer, 100, flush_stdout, 0, 0 );
#endif

        return c;
    }

flush:
    flush_stdout(0);
    return c;
}