diff options
| author | Dmitrij Tejblum <dt@FreeBSD.org> | 1998-10-09 19:01:30 +0000 |
|---|---|---|
| committer | Dmitrij Tejblum <dt@FreeBSD.org> | 1998-10-09 19:01:30 +0000 |
| commit | 4b12016bab74b93e6e7dd3905029f01b5a02fb80 (patch) | |
| tree | cbf2790ce98d3ea1708a646ed1dcc4a498f02f63 /lib/libpthread/thread/thr_kern.c | |
| parent | e95de2a60263532878cdbcd453d7afbed4c665b3 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_kern.c')
| -rw-r--r-- | lib/libpthread/thread/thr_kern.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index da125cd3e645..22746c7d211e 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: uthread_kern.c,v 1.12 1998/09/07 21:55:01 alex Exp $ + * $Id: uthread_kern.c,v 1.13 1998/09/30 06:36:56 jb Exp $ * */ #include <errno.h> @@ -206,10 +206,12 @@ __asm__("fnsave %0": :"m"(*fdata)); * Accumulate the number of microseconds that this * thread has run for: */ - _thread_run->slice_usec += (_thread_run->last_inactive.tv_sec - - _thread_run->last_active.tv_sec) * 1000000 + - _thread_run->last_inactive.tv_usec - - _thread_run->last_active.tv_usec; + if (_thread_run->slice_usec != -1) { + _thread_run->slice_usec += (_thread_run->last_inactive.tv_sec - + _thread_run->last_active.tv_sec) * 1000000 + + _thread_run->last_inactive.tv_usec - + _thread_run->last_active.tv_usec; + } /* * Check if this thread has reached its allocated @@ -242,7 +244,7 @@ __asm__("fnsave %0": :"m"(*fdata)); * the last incremental priority check was * made: */ - else if (timercmp(&_thread_run->last_inactive, &kern_inc_prio_time, <)) { + else if (timercmp(&pthread->last_inactive, &kern_inc_prio_time, <)) { /* * Increment the incremental priority * for this thread in the hope that @@ -582,6 +584,7 @@ __asm__("fnsave %0": :"m"(*fdata)); * Do a sigreturn to restart the thread that * was interrupted by a signal: */ + _thread_kern_in_sched = 0; _thread_sys_sigreturn(&_thread_run->saved_sigcontext); } else /* |
