kern_time.c (168951) | kern_time.c (170307) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/kern/kern_time.c 168951 2007-04-22 15:31:22Z rwatson $"); | 33__FBSDID("$FreeBSD: head/sys/kern/kern_time.c 170307 2007-06-05 00:00:57Z jeff $"); |
34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/limits.h> 38#include <sys/clock.h> 39#include <sys/lock.h> 40#include <sys/mutex.h> 41#include <sys/sysproto.h> --- 505 unchanged lines hidden (view full) --- 547 if (timevalisset(&aitv->it_value)) { 548 getmicrouptime(&ctv); 549 if (timevalcmp(&aitv->it_value, &ctv, <)) 550 timevalclear(&aitv->it_value); 551 else 552 timevalsub(&aitv->it_value, &ctv); 553 } 554 } else { | 34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/limits.h> 38#include <sys/clock.h> 39#include <sys/lock.h> 40#include <sys/mutex.h> 41#include <sys/sysproto.h> --- 505 unchanged lines hidden (view full) --- 547 if (timevalisset(&aitv->it_value)) { 548 getmicrouptime(&ctv); 549 if (timevalcmp(&aitv->it_value, &ctv, <)) 550 timevalclear(&aitv->it_value); 551 else 552 timevalsub(&aitv->it_value, &ctv); 553 } 554 } else { |
555 mtx_lock_spin(&sched_lock); | 555 PROC_SLOCK(p); |
556 *aitv = p->p_stats->p_timer[which]; | 556 *aitv = p->p_stats->p_timer[which]; |
557 mtx_unlock_spin(&sched_lock); | 557 PROC_SUNLOCK(p); |
558 } 559 return (0); 560} 561 562#ifndef _SYS_SYSPROTO_H_ 563struct setitimer_args { 564 u_int which; 565 struct itimerval *itv, *oitv; --- 52 unchanged lines hidden (view full) --- 618 PROC_UNLOCK(p); 619 if (timevalisset(&oitv->it_value)) { 620 if (timevalcmp(&oitv->it_value, &ctv, <)) 621 timevalclear(&oitv->it_value); 622 else 623 timevalsub(&oitv->it_value, &ctv); 624 } 625 } else { | 558 } 559 return (0); 560} 561 562#ifndef _SYS_SYSPROTO_H_ 563struct setitimer_args { 564 u_int which; 565 struct itimerval *itv, *oitv; --- 52 unchanged lines hidden (view full) --- 618 PROC_UNLOCK(p); 619 if (timevalisset(&oitv->it_value)) { 620 if (timevalcmp(&oitv->it_value, &ctv, <)) 621 timevalclear(&oitv->it_value); 622 else 623 timevalsub(&oitv->it_value, &ctv); 624 } 625 } else { |
626 mtx_lock_spin(&sched_lock); | 626 PROC_SLOCK(p); |
627 *oitv = p->p_stats->p_timer[which]; 628 p->p_stats->p_timer[which] = *aitv; | 627 *oitv = p->p_stats->p_timer[which]; 628 p->p_stats->p_timer[which] = *aitv; |
629 mtx_unlock_spin(&sched_lock); | 629 PROC_SUNLOCK(p); |
630 } 631 return (0); 632} 633 634/* 635 * Real interval timer expired: 636 * send process whose timer expired an alarm signal. 637 * If time is not set up to reload, then just return. --- 849 unchanged lines hidden --- | 630 } 631 return (0); 632} 633 634/* 635 * Real interval timer expired: 636 * send process whose timer expired an alarm signal. 637 * If time is not set up to reload, then just return. --- 849 unchanged lines hidden --- |