kern_acct.c (170174) | kern_acct.c (170307) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * Copyright (c) 2005 Robert N. M. Watson 6 * All rights reserved. 7 * 8 * All or some portions of this file are derived from material licensed --- 54 unchanged lines hidden (view full) --- 63 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 64 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 65 * SUCH DAMAGE. 66 * 67 * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93 68 */ 69 70#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * Copyright (c) 2005 Robert N. M. Watson 6 * All rights reserved. 7 * 8 * All or some portions of this file are derived from material licensed --- 54 unchanged lines hidden (view full) --- 63 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 64 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 65 * SUCH DAMAGE. 66 * 67 * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93 68 */ 69 70#include <sys/cdefs.h> |
71__FBSDID("$FreeBSD: head/sys/kern/kern_acct.c 170174 2007-06-01 01:12:45Z jeff $"); | 71__FBSDID("$FreeBSD: head/sys/kern/kern_acct.c 170307 2007-06-05 00:00:57Z jeff $"); |
72 73#include "opt_mac.h" 74 75#include <sys/param.h> 76#include <sys/systm.h> 77#include <sys/acct.h> 78#include <sys/fcntl.h> 79#include <sys/kernel.h> --- 527 unchanged lines hidden (view full) --- 607 */ 608static void 609acct_thread(void *dummy) 610{ 611 u_char pri; 612 613 /* This is a low-priority kernel thread. */ 614 pri = PRI_MAX_KERN; | 72 73#include "opt_mac.h" 74 75#include <sys/param.h> 76#include <sys/systm.h> 77#include <sys/acct.h> 78#include <sys/fcntl.h> 79#include <sys/kernel.h> --- 527 unchanged lines hidden (view full) --- 607 */ 608static void 609acct_thread(void *dummy) 610{ 611 u_char pri; 612 613 /* This is a low-priority kernel thread. */ 614 pri = PRI_MAX_KERN; |
615 mtx_lock_spin(&sched_lock); | 615 thread_lock(curthread); |
616 sched_prio(curthread, pri); | 616 sched_prio(curthread, pri); |
617 mtx_unlock_spin(&sched_lock); | 617 thread_unlock(curthread); |
618 619 /* If another accounting kthread is already running, just die. */ 620 sx_xlock(&acct_sx); 621 if (acct_state & ACCT_RUNNING) { 622 sx_xunlock(&acct_sx); 623 kthread_exit(0); 624 } 625 acct_state |= ACCT_RUNNING; --- 26 unchanged lines hidden --- | 618 619 /* If another accounting kthread is already running, just die. */ 620 sx_xlock(&acct_sx); 621 if (acct_state & ACCT_RUNNING) { 622 sx_xunlock(&acct_sx); 623 kthread_exit(0); 624 } 625 acct_state |= ACCT_RUNNING; --- 26 unchanged lines hidden --- |