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

Christopher Fowler cfowler at outpostsentinel.com
Wed Jul 23 12:20:41 EDT 2003


Remove the '&' and that should pass the function through.  What
are the errors you are getting?


On Wed, Jul 23, 2003 at 12:21:02PM -0400, John Mills wrote:
> 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
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list