|
|
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: * HISTORY ! 35: * 11-Jul-91 Gregg Kellogg (gk) at NeXT ! 36: * Initial version. ! 37: */ ! 38: /* ! 39: * File: kernserv/lock.h ! 40: * Author: Avadis Tevanian, Jr., Michael Wayne Young ! 41: * Copyright (C) 1985, Avadis Tevanian, Jr., Michael Wayne Young ! 42: * ! 43: * Exported locking primitives definitions ! 44: * ! 45: */ ! 46: ! 47: #ifdef KERNEL_PRIVATE ! 48: #warning Obsolete header file: <kernserv/lock.h>. use <kern/lock.h> \ ! 49: instead; or better yet, just say no!! ! 50: #import <kern/lock.h> ! 51: ! 52: #else /* KERNEL_PRIVATE */ ! 53: ! 54: #ifndef _KERN_LOCK_H_ ! 55: #define _KERN_LOCK_H_ ! 56: ! 57: #import <mach/boolean.h> ! 58: ! 59: /* ! 60: * A simple spin lock. ! 61: */ ! 62: ! 63: #import <mach/machine/simple_lock.h> ! 64: ! 65: typedef void *lock_t; ! 66: ! 67: /* Sleep locks must work even if no multiprocessing */ ! 68: ! 69: extern lock_t lock_alloc(); ! 70: extern void lock_free(); ! 71: extern void lock_init(); ! 72: extern void lock_sleepable(); ! 73: extern void lock_write(); ! 74: extern void lock_read(); ! 75: extern void lock_done(); ! 76: extern boolean_t lock_read_to_write(); ! 77: extern void lock_write_to_read(); ! 78: extern boolean_t lock_try_write(); ! 79: extern boolean_t lock_try_read(); ! 80: extern boolean_t lock_try_read_to_write(); ! 81: ! 82: #define lock_read_done(l) lock_done(l) ! 83: #define lock_write_done(l) lock_done(l) ! 84: ! 85: extern void lock_set_recursive(); ! 86: extern void lock_clear_recursive(); ! 87: ! 88: #endif /* _KERN_LOCK_H_ */ ! 89: ! 90: #endif /* KERNEL_PRIVATE */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.