1 |
/* |
/* |
2 |
* Mach Operating System |
* Mach Operating System |
3 |
* Copyright (c) 1991,1990,1989 Carnegie Mellon University |
* Copyright (c) 1992,1991,1990,1989 Carnegie Mellon University |
4 |
* All Rights Reserved. |
* All Rights Reserved. |
5 |
* |
* |
6 |
* Permission to use, copy, modify and distribute this software and its |
* Permission to use, copy, modify and distribute this software and its |
26 |
/* |
/* |
27 |
* HISTORY |
* HISTORY |
28 |
* $Log$ |
* $Log$ |
29 |
* Revision 1.1 1992/10/06 18:31:06 mib |
* Revision 1.2 2002/05/27 02:50:10 roland |
30 |
* entered into RCS |
* 2002-05-26 Roland McGrath <roland@frob.com> |
31 |
* |
* |
32 |
|
* Changes merged from CMU MK83a version: |
33 |
|
* * cthreads.h, options.h: Various cleanups. |
34 |
|
* * call.c, cthread_data.c, sync.c, mig_support.c: Likewise. |
35 |
|
* * i386/cthreads.h, i386/thread.c, i386/lock.s: Likewise. |
36 |
|
* * cthread_internals.h: Add decls for internal functions. |
37 |
|
* (struct cproc): Use vm_offset_t for stack_base and stack_size members. |
38 |
|
* Use natural_t for context member. |
39 |
|
* * cprocs.c: Use prototypes for all defns. |
40 |
|
* * cthreads.c: Likewise. |
41 |
|
* (cthread_exit): Cast any_t to integer_t before int. |
42 |
|
* |
43 |
|
* Revision 2.8 93/01/14 18:06:23 danner |
44 |
|
* Converted file to ANSI C. |
45 |
|
* [92/12/18 pds] |
46 |
|
* |
47 |
* Revision 2.7 92/03/06 14:09:59 rpd |
* Revision 2.7 92/03/06 14:09:59 rpd |
48 |
* Replaced swtch_pri with yield. |
* Replaced swtch_pri with yield. |
49 |
* [92/03/06 rpd] |
* [92/03/06 rpd] |
87 |
int cthread_spin_count=0; |
int cthread_spin_count=0; |
88 |
|
|
89 |
void |
void |
90 |
spin_lock_solid(p) |
spin_lock_solid(register spin_lock_t *p) |
|
register spin_lock_t *p; |
|
91 |
{ |
{ |
92 |
while (spin_lock_locked(p) || !spin_try_lock(p)) { |
while (spin_lock_locked(p) || !spin_try_lock(p)) { |
93 |
#ifdef STATISTICS |
#ifdef STATISTICS |