全部博文(32)
分类: LINUX
2011-06-26 22:47:04
wangjianchangdx2011-06-26 23:43:19
/*
* include/linux/spinlock.h - generic spinlock/rwlock declarations
*
* here's the role of the various spinlock/rwlock related include files:
*
* on SMP builds:
*
* asm/spinlock_types.h: contains the arch_spinlock_t/arch_rwlock_t and the
* initializers
*
* linux/spinlock_types.h:
*&nbs
wangjianchangdx2011-06-26 23:25:06
include/linux/spinlock_types.h:
根据UP/SMP包含不同的头文件,
#if defined(CONFIG_SMP)
# include <asm/spinlock_types.h>
#else
# include <linux/spinlock_types_up.h>
#endif
好吧,有的跟了
#include <linux/lockdep.h>
wangjianchangdx2011-06-26 23:05:56
include/linux/semaphore.h:
#include <linux/list.h>
#include <linux/spinlock.h> 可见semaphore建立在spinlock的基础上
/* Please don't access any members of this structure directly */
struct semaphore {
spinlock_t lock;
unsigned int count;