diff --git a/src/bin/shell/commands.c b/src/bin/shell/commands.c index f2f4dfb..6c59271 100644 --- a/src/bin/shell/commands.c +++ b/src/bin/shell/commands.c @@ -47,13 +47,14 @@ else if (memcmp(data->args->arg,"stress", 6) == 0) { while (1) { cPid = fork(); - if (!cPid) { + if (cPid == 0x0) { printf("Pid: [%i]\n",cPid); exec("clock",0x0,0x0); - exit(-1); + printf("Error: should not get here\n"); + exit(0x1); } else { - while (pidStatus(cPid)) + while (pidStatus(cPid) > 0) sched_yield(); } } diff --git a/src/bin/ubistry/main.c b/src/bin/ubistry/main.c index 4f1d41f..96dfec0 100644 --- a/src/bin/ubistry/main.c +++ b/src/bin/ubistry/main.c @@ -38,7 +38,7 @@ //FILE *pidFile; if (fork() != 0x0) { - //sched_yield(); + sched_yield(); /* This Fixed our segfault issue how ever it is the result of a deeper issue */ exit(0x0); } @@ -57,6 +57,9 @@ /*** $Log$ + Revision 1.7 2004/06/17 15:10:55 reddawg + Fixed Some Global Variables + Revision 1.6 2004/06/10 13:08:00 reddawg Minor Bug Fixes diff --git a/src/sys/kernel/spinlock.c b/src/sys/kernel/spinlock.c index 51f8de8..ea1480c 100644 --- a/src/sys/kernel/spinlock.c +++ b/src/sys/kernel/spinlock.c @@ -28,6 +28,7 @@ *****************************************************************************************/ #include +#include inline void spinLockInit(spinLock_t *lock) { *lock = SPIN_LOCK_INITIALIZER; @@ -35,6 +36,7 @@ inline void spinUnlock(spinLock_t *lock) { register int unlocked; + assert(lock); __asm__ __volatile ( "xchgl %0, %1" : "=&r" (unlocked), "=m" (*lock) : "0" (0) @@ -43,6 +45,7 @@ inline int spinTryLock(spinLock_t *lock) { register int locked; + assert(lock); __asm__ __volatile ("xchgl %0, %1" : "=&r" (locked), "=m" (*lock) : "0" (1) ); @@ -50,17 +53,22 @@ } inline void spinLock(spinLock_t *lock) { + assert(lock); while (! spinTryLock(lock)) while (*lock == 1); } inline int spinLockLocked(spinLock_t *lock) { + assert(lock); return(*lock != 0); } /*** $Log$ + Revision 1.4 2004/05/21 12:42:32 reddawg + Cleaned Up + Revision 1.3 2004/05/15 02:30:28 reddawg Lots of changes