웹프로그래밍
C++ : 특정 클래스의 멤버함수A에서 멤버함수B를 스레드로 생성하기 본문
dfb_some_function 에서 dfb_refresh_timelines를 스레드로 생성하는 예제.
class dfb{
public:
void dfb_some_function();
friend void *call_dfb_refrash_timelines(void *arg);
void dfb_refresh_timelines();
private:
pthread_t thread_refresh_ui;
}
void *call_dfb_refrash_timelines(void *arg){
static_cast<dfb*>(arg)->dfb_refresh_timelines();
}
void dfb::dfb_refresh_timelines(){
printf("Hello\n");
}
void dfb::dfb_some_function(){
pthread_create(&thread_refresh_ui, NULL, call_dfb_refrash_timelines, this);
}
'프로그래밍일반' 카테고리의 다른 글
파이썬공부 python (0) | 2016.07.13 |
---|---|
C++ STL : Functor 사용하기 (0) | 2016.07.13 |
C++ 다른 클래스의 멤버변수에 직접 접근하기 (0) | 2016.07.13 |
Link Error : winsock을 사용하는 프로그램 빌드 시 link error대처 (0) | 2016.07.13 |
IA Register Set (0) | 2016.07.13 |
Comments