I have seen how to launch threads in my project, where we are using ACE library . But I have a question when ACE_TASK doesn't have any activate function how can you call it in class derived from MyClass class . The activate function is in ACE_TASK_BASE class which is derived from ACE_TASK . But MyClass class and ACE_TASK_BASE doesn't have any direct relation ?
class MyClass: public ACE_Task< ACE_MT_SYNCH > {
public:
//derived from ACE_Task
virtual int open( void *arg = NULL );
//derived from ACE_Task
virtual int svc();
};
//then we are calling
this->activate(); // ?????
in open(); //running our job in
int svc() {
while( _running )
....
}
Aucun commentaire:
Enregistrer un commentaire