I work with pthreads and I want to use this code:
if(pthread_mutex_lock(&lock)){
cout<<"error"<<endl;
return ERROR;
}
my question is should I do it with #define
or should I do it with inline function:
inline void func() {
if(pthread_mutex_lock(&lock)){
cout<<"error"<<endl;
return ERROR;
}
}
Should the function be static? such as:
static inline void func()