kern_mutex.c (192853) | kern_mutex.c (193035) |
---|---|
1/*- 2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 20 unchanged lines hidden (view full) --- 29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $ 30 */ 31 32/* 33 * Machine independent bits of mutex implementation. 34 */ 35 36#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 20 unchanged lines hidden (view full) --- 29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $ 30 */ 31 32/* 33 * Machine independent bits of mutex implementation. 34 */ 35 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/kern/kern_mutex.c 192853 2009-05-26 20:28:22Z sson $"); | 37__FBSDID("$FreeBSD: head/sys/kern/kern_mutex.c 193035 2009-05-29 13:56:34Z jhb $"); |
38 39#include "opt_adaptive_mutexes.h" 40#include "opt_ddb.h" 41#include "opt_global.h" 42#include "opt_kdtrace.h" 43#include "opt_sched.h" 44 45#include <sys/param.h> --- 348 unchanged lines hidden (view full) --- 394 if (v == MTX_UNOWNED) { 395 turnstile_cancel(ts); 396 cpu_spinwait(); 397 continue; 398 } 399 400#ifdef ADAPTIVE_MUTEXES 401 /* | 38 39#include "opt_adaptive_mutexes.h" 40#include "opt_ddb.h" 41#include "opt_global.h" 42#include "opt_kdtrace.h" 43#include "opt_sched.h" 44 45#include <sys/param.h> --- 348 unchanged lines hidden (view full) --- 394 if (v == MTX_UNOWNED) { 395 turnstile_cancel(ts); 396 cpu_spinwait(); 397 continue; 398 } 399 400#ifdef ADAPTIVE_MUTEXES 401 /* |
402 * If the current owner of the lock is executing on another 403 * CPU quit the hard path and try to spin. | 402 * The current lock owner might have started executing 403 * on another CPU (or the lock could have changed 404 * owners) while we were waiting on the turnstile 405 * chain lock. If so, drop the turnstile lock and try 406 * again. |
404 */ 405 owner = (struct thread *)(v & ~MTX_FLAGMASK); 406 if (TD_IS_RUNNING(owner)) { 407 turnstile_cancel(ts); 408 cpu_spinwait(); 409 continue; 410 } 411#endif --- 500 unchanged lines hidden --- | 407 */ 408 owner = (struct thread *)(v & ~MTX_FLAGMASK); 409 if (TD_IS_RUNNING(owner)) { 410 turnstile_cancel(ts); 411 cpu_spinwait(); 412 continue; 413 } 414#endif --- 500 unchanged lines hidden --- |