2012-11-16 4 views
0
typedef void (*work_func_t)(struct work_struct *work); 

위의 typedef가 Linux 커널 소스 코드에서 발견되었지만 이해가되지 않습니다. 누구든지 나에게 설명을 해줄 수 있니? 감사!리눅스 커널에서이 'typedef'의 의미는 무엇입니까?

보완 다음 "타입 정의를"다음 위의 코드에서

struct work_struct { 
    atomic_long_t data; 
#define WORK_STRUCT_PENDING 0  /* T if work item pending execution */ 
#define WORK_STRUCT_STATIC 1  /* static initializer (debugobjects) */ 
#define WORK_STRUCT_FLAG_MASK (3UL) 
#define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) 
    struct list_head entry; 
    work_func_t func; 
#ifdef CONFIG_LOCKDEP 
    struct lockdep_map lockdep_map; 
#endif 
}; 

, 나는 지금 그것을 이해할 수있다. @ piokuc 맞아, 고마워!

+0

그 기능 포인터 구문 - 이전에 건너 왔 으면 Google 기능 포인터 – mathematician1975

답변

2

work_func_t은 매개 변수로 struct work_struct에 대한 포인터를 받아들이고 아무것도 반환하지 않는 함수에 대한 포인터의 형식 별칭입니다 (void).