由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 弱问C编程一个关于static问题
相关主题
how to statically initialze a mutex in class?static vector 怎么 initialize ?
C++ InitializeCriticalSection问题关于C/C++里的Static variable的memory allocation/initializa
static initialization dependency c++C++: Static initialization dependency
c++ 不自动initialize变量么?请教大家一道C的面试题
pthread_create inside a constructor[合集] static const代替define的performance tradeoff在哪里?
请问static variable init的问题?double-checked locking
C++类的静态函数对成员函数is pthread_mutex_destroy() required to call?
error LNK2001:的错误如何改正?请教pthread producer-consumer问题
相关话题的讨论汇总
话题: mutex话题: define话题: static话题: mutexname话题: dst
进入Programming版参与讨论
1 (共1页)
x*******i
发帖数: 14
1
static DEFINE_MUTEX(dst_gc_mutex); //code is in linux/net/core/dst.c
question: in this line, static is used to define what? variable or function?
tks!
X****r
发帖数: 3557
2
DEFINE_MUTEX是一个宏,定义在linux/include/linux/mutex.h
#define DEFINE_MUTEX(mutexname) \
struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
所以这里static是用来修饰一个变量dst_gc_mutex。

function?

【在 x*******i 的大作中提到】
: static DEFINE_MUTEX(dst_gc_mutex); //code is in linux/net/core/dst.c
: question: in this line, static is used to define what? variable or function?
: tks!
:

1 (共1页)
进入Programming版参与讨论
相关主题
请教pthread producer-consumer问题pthread_create inside a constructor
Any examples for implementing user-level threads library in C?请问static variable init的问题?
Re: can destructor be static?C++类的静态函数对成员函数
Test your C++ knowledge... error LNK2001:的错误如何改正?
how to statically initialze a mutex in class?static vector 怎么 initialize ?
C++ InitializeCriticalSection问题关于C/C++里的Static variable的memory allocation/initializa
static initialization dependency c++C++: Static initialization dependency
c++ 不自动initialize变量么?请教大家一道C的面试题
相关话题的讨论汇总
话题: mutex话题: define话题: static话题: mutexname话题: dst