Annotation of kernel/kernserv/sched_prim.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
                      7:  * Reserved.  This file contains Original Code and/or Modifications of
                      8:  * Original Code as defined in and that are subject to the Apple Public
                      9:  * Source License Version 1.1 (the "License").  You may not use this file
                     10:  * except in compliance with the License.  Please obtain a copy of the
                     11:  * License at http://www.apple.com/publicsource and read it before using
                     12:  * this file.
                     13:  * 
                     14:  * The Original Code and all software distributed under the License are
                     15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     19:  * License for the specific language governing rights and limitations
                     20:  * under the License.
                     21:  * 
                     22:  * @APPLE_LICENSE_HEADER_END@
                     23:  */
                     24: 
                     25: /* 
                     26:  * Mach Operating System
                     27:  * Copyright (c) 1989 Carnegie-Mellon University
                     28:  * Copyright (c) 1988 Carnegie-Mellon University
                     29:  * Copyright (c) 1987 Carnegie-Mellon University
                     30:  * All rights reserved.  The CMU software License Agreement specifies
                     31:  * the terms and conditions for use and redistribution.
                     32:  */
                     33: /*
                     34:  *     File:   sched_prim.h
                     35:  *     Author: David Golub
                     36:  *
                     37:  *     Scheduling primitive definitions file
                     38:  *
                     39:  */
                     40: 
                     41: #ifndef        _KERN_INTERNAL_SCHED_PRIM_H_
                     42: #define _KERN_INTERNAL_SCHED_PRIM_H_
                     43: 
                     44: /*
                     45:  *     Possible results of assert_wait - returned in
                     46:  *     current_thread()->wait_result.
                     47:  */
                     48: #define THREAD_AWAKENED                0               /* normal wakeup */
                     49: #define THREAD_TIMED_OUT       1               /* timeout expired */
                     50: #define THREAD_INTERRUPTED     2               /* interrupted by clear_wait */
                     51: #define THREAD_SHOULD_TERMINATE        3               /* thread should terminate */
                     52: #define THREAD_RESTART         4               /* restart operation entirely */
                     53: 
                     54: /*
                     55:  *     Exported interface to sched_prim.c 
                     56:  */
                     57: 
                     58: extern void    sched_init();
                     59: extern void    assert_wait();
                     60: extern void    clear_wait();
                     61: extern void    thread_sleep();
                     62: extern void    thread_wakeup();                /* for function pointers */
                     63: extern void    thread_wakeup_prim();
                     64: extern void    thread_block();
                     65: extern void    thread_run();
                     66: extern void    thread_set_timeout();
                     67: extern void    thread_setrun();
                     68: extern int     thread_wait_result();
                     69: 
                     70: /*
                     71:  *     Routines defined as macros
                     72:  */
                     73: 
                     74: #define thread_wakeup(x)                                               \
                     75:                thread_wakeup_prim((x), FALSE, THREAD_AWAKENED)
                     76: #define thread_wakeup_with_result(x, z)                                        \
                     77:                thread_wakeup_prim((x), FALSE, (z))
                     78: #define thread_wakeup_one(x)                                           \
                     79:                thread_wakeup_prim((x), TRUE, THREAD_AWAKENED)
                     80: 
                     81: #endif /* _KERN_INTERNAL_SCHED_PRIM_H_ */
                     82: 

unix.superglobalmegacorp.com

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