threads in c++ using classes

Alfred Reynolds alfred at mazuma.net.au
Mon Mar 11 21:23:17 EST 2002


Short answer is no :)
C++ (classes) and threads don't play friendly. Threads can't access 
member functions (without some serious skulldugery).
I don't know about SDL, but you should look into using one of the C++ 
threading classes (which hides the magic from ya, which is good). Have 
you checked what SDL offers?

rohan mitchell wrote:
> Is it possible to to use threads (i am using SDL threads), where the
> function
> being executed is a function in a class? When i try, i get the error:
> no matches converting function 'processPlayerInput' to type 'int
> (*)(void *)'
> candidates are: int
> RealityUndefined::ServerUniverse::processPlayerInput(RealityUndefined:
> :NetworkServerConnection *)
> 
> I don't get these errors when using plain functions outside of a
> class(c style).
> 
> Thanks in advance,
> Rohan
> 
> 
> __________________________________________________________________
> Get your free Australian email account at http://www.start.com.au
> 
> 


-- 
Alfred Reynolds
alfred at mazuma.net.au





More information about the linux mailing list