[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-cxx-dev
Subject:    Re: CXX-DEV: Active objects with DCE threads (on HP-UX 10.20 using aC++)
From:       Saadat Dowlati <sdowlati () sw ! stratus ! com>
Date:       1998-07-20 20:51:02
[Download RAW message or body]



On Mon, 20 Jul 1998 13:01:22,  Len Lattanzi wrote:
Try the following
> //////////////////////////////
> // .hh file:
> class Agent {
>    public:
>       Agent();
>       virtual       ~Agent() {//...}
>  
>    private:
>       thread_t      thread_id;
> 	  int			init();
       static void   *run(pthread_addr_t arg); // thread start routine
> 	  // ...
> };
> 
> //.cc file:
...
void * // never use static on an out-of-line member function definition
> Agent::run(pthread_addr_t arg)		// this is line 99
> {
>    Agent  *agent = (Agent *)arg;
>    // ...
> }
> 


This solved the compile error. Thanks!

BTW, the sample C code in "Programming with Threads on HP-UX" defines the
thread's start routine as "void" and not "void *" ... but I should've
followed the pthread_create man page syntax and used "pthread_startroutine_t".
--
Thanks to all who helped,
sd
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE cxx-dev
 To reply to the list, send mail to cxx-dev@cxx.cup.hp.com
 _________________________________________________________________

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic