Notice
Recent Posts
Recent Comments
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags
more
Archives
Today
Total
관리 메뉴

웹프로그래밍

C++ : 특정 클래스의 멤버함수A에서 멤버함수B를 스레드로 생성하기 본문

프로그래밍일반

C++ : 특정 클래스의 멤버함수A에서 멤버함수B를 스레드로 생성하기

공부모드 2016. 7. 13. 05:36

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);
}



Comments