From: kris d. <t_...@ya...> - 2007-04-10 18:49:22
|
Hi, I want to start a thread within a class : class protocol { private: void* thread(void* arg); public: void run(void); } void protocol::run(void) { [...] pthread_create(id, NULL, &thread, NULL); } As I can see, G++ tells me that I can't do that... If I change the &thread for (void(*) void*) &protocol::thread I receive some other errors... So I think I can't call pthread_create within a class. Am I right ? Is there any workaround ? Thank you |