diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-05-28 12:16:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-05-28 12:16:35 +0000 |
commit | b37b81cfca9ff2e0e829ab2cea5294a307877e82 (patch) | |
tree | af2a1a88a7cc3ab490635f0eb97487a27d16b68e /sys/vm/kern_lock.c | |
parent | e03354c0b9b1329837646f6357a67ba29949753a (diff) |
thread changes
Diffstat (limited to 'sys/vm/kern_lock.c')
-rw-r--r-- | sys/vm/kern_lock.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/sys/vm/kern_lock.c b/sys/vm/kern_lock.c index f81ca2d4641..2d61239ee37 100644 --- a/sys/vm/kern_lock.c +++ b/sys/vm/kern_lock.c @@ -70,10 +70,15 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/proc.h> #include <vm/vm.h> +/* XXX */ +#include <sys/proc.h> +typedef void *thread_t; +#define current_thread() ((thread_t)&curproc->p_thread) +/* XXX */ + #if NCPUS > 1 /* @@ -165,7 +170,7 @@ void lock_init(l, can_sleep) l->want_upgrade = FALSE; l->read_count = 0; l->can_sleep = can_sleep; - l->thread = (thread_t)-1; /* XXX */ + l->thread = (char *)-1; /* XXX */ l->recursion_depth = 0; } @@ -192,7 +197,7 @@ void lock_write(l) simple_lock(&l->interlock); - if (l->thread == (thread_t)¤t_thread()) { + if (((thread_t)l->thread) == current_thread()) { /* * Recursive lock. */ @@ -270,7 +275,7 @@ void lock_read(l) simple_lock(&l->interlock); - if (l->thread == (thread_t)¤t_thread()) { + if (((thread_t)l->thread) == current_thread()) { /* * Recursive lock. */ @@ -317,7 +322,7 @@ boolean_t lock_read_to_write(l) l->read_count--; - if (l->thread == (thread_t)¤t_thread()) { + if (((thread_t)l->thread) == current_thread()) { /* * Recursive lock. */ @@ -399,7 +404,7 @@ boolean_t lock_try_write(l) simple_lock(&l->interlock); - if (l->thread == (thread_t)¤t_thread()) { + if (((thread_t)l->thread) == current_thread()) { /* * Recursive lock */ @@ -438,7 +443,7 @@ boolean_t lock_try_read(l) { simple_lock(&l->interlock); - if (l->thread == (thread_t)¤t_thread()) { + if (((thread_t)l->thread) == current_thread()) { /* * Recursive lock */ @@ -473,7 +478,7 @@ boolean_t lock_try_read_to_write(l) simple_lock(&l->interlock); - if (l->thread == (thread_t)¤t_thread()) { + if (((thread_t)l->thread) == current_thread()) { /* * Recursive lock */ @@ -511,7 +516,7 @@ void lock_set_recursive(l) if (!l->want_write) { panic("lock_set_recursive: don't have write lock"); } - l->thread = (thread_t)¤t_thread(); + l->thread = (char *) current_thread(); simple_unlock(&l->interlock); } @@ -522,10 +527,10 @@ void lock_clear_recursive(l) lock_t l; { simple_lock(&l->interlock); - if (l->thread != (thread_t)¤t_thread()) { + if (((thread_t) l->thread) != current_thread()) { panic("lock_clear_recursive: wrong thread"); } if (l->recursion_depth == 0) - l->thread = (thread_t)-1; /* XXX */ + l->thread = (char *)-1; /* XXX */ simple_unlock(&l->interlock); } |