Annotation of researchv10no/cmd/cfront/libC/task/timer.c, revision 1.1

1.1     ! root        1: /*ident        "%W%" */
        !             2: /**************************************************************************
        !             3:                        Copyright (c) 1984 AT&T
        !             4:                          All Rights Reserved   
        !             5: 
        !             6:        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
        !             7:        
        !             8:        The copyright notice above does not evidence any        
        !             9:        actual or intended publication of such source code.
        !            10: 
        !            11: *****************************************************************************/
        !            12: #include <task.h>
        !            13: 
        !            14: timer::timer(int d)
        !            15: {
        !            16:        s_state = IDLE;
        !            17:        insert(d, (object*)this);
        !            18: }
        !            19: 
        !            20: timer::~timer()
        !            21: {
        !            22:        if (s_state != TERMINATED) task_error(E_TIMERDEL, this);
        !            23: }
        !            24: 
        !            25: void
        !            26: timer::reset(int d)
        !            27: {
        !            28:        remove();
        !            29:        insert(d, (object*)this);
        !            30: }
        !            31: 
        !            32: void
        !            33: timer::print(int n, int baseClass)
        !            34: { 
        !            35:        if (!baseClass)
        !            36:                printf("timer %ld == clock+%ld\n",s_time,s_time - get_clock());
        !            37: 
        !            38:        sched::print(n, 1);
        !            39: }
        !            40: 
        !            41: void
        !            42: timer::resume()  // time is up; "delete" timer & schedule next task
        !            43: {
        !            44:        s_state = TERMINATED;
        !            45:        alert();
        !            46:        schedule();
        !            47: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.