#ifndef __LINUX_INSIDE_SPINLOCK_H # error "Please do not include this file directly." #endif
/* * rwlock related methods * * split out from spinlock.h * * portions Copyright 2005, Red Hat, Inc., Ingo Molnar * Released under the General Public License (GPL).
*/
#ifdef CONFIG_DEBUG_SPINLOCK externvoid do_raw_read_lock(rwlock_t *lock) __acquires(lock); externint do_raw_read_trylock(rwlock_t *lock); externvoid do_raw_read_unlock(rwlock_t *lock) __releases(lock); externvoid do_raw_write_lock(rwlock_t *lock) __acquires(lock); externint do_raw_write_trylock(rwlock_t *lock); externvoid do_raw_write_unlock(rwlock_t *lock) __releases(lock); #else # define do_raw_read_lock(rwlock) do {__acquire(lock); arch_read_lock(&(rwlock)->raw_lock); } while (0) # define do_raw_read_trylock(rwlock) arch_read_trylock(&(rwlock)->raw_lock) # define do_raw_read_unlock(rwlock) do {arch_read_unlock(&(rwlock)->raw_lock); __release(lock); } while (0) # define do_raw_write_lock(rwlock) do {__acquire(lock); arch_write_lock(&(rwlock)->raw_lock); } while (0) # define do_raw_write_trylock(rwlock) arch_write_trylock(&(rwlock)->raw_lock) # define do_raw_write_unlock(rwlock) do {arch_write_unlock(&(rwlock)->raw_lock); __release(lock); } while (0) #endif
/* * Define the various rw_lock methods. Note we define these * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various * methods are defined as nops in the case they are not required.
*/ #define read_trylock(lock) __cond_lock(lock, _raw_read_trylock(lock)) #define write_trylock(lock) __cond_lock(lock, _raw_write_trylock(lock))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.