[ale] OT: dummy C++/threads question

John Mills johnmills at speakeasy.net
Wed Jul 23 12:21:02 EDT 2003


ALErs (C++ gurus??) -

I have a C++ class with a member function, say:

void * CMyClass::MyFunction(void * myArgs) {blah}

I want to this function to be executed in a thread started by another 
member of the same class:

fnType CMyClass::MyManager()
{
  ...
  pthread_create(&someInt, NULL, &CMyclass::MyFunction, &someStruct);
  // can't get this right-->>    ^^^^^^^^^^^^^^^^^^^^^
}

How can I pass the pointer to my member function?

TIA.

 John Mills
 john.m.mills at alum.mit.edu

_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list