bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with Common C++ threads.


From: Pe?a Arellano Fabi?n Erasmo
Subject: Help with Common C++ threads.
Date: Tue, 22 Jan 2002 16:47:45 -0600 (CST)

        Hello:

        My name is Fabi?n Pe?a and I am writing since I'm having problems
using threads in Common C++.
        Bellow I send the program which does not work. It is a simple
"Hello World" program with a single thread besides the main one. The
problem is that it doesn't seem to be excecuting the member function
Run(), which as far as I understand is where the code the thread must
execute must be.
        I understood that the main() function must not call Run()
explicity since it is called by the execHandler function which is
called by the Start() function which is explicity called by main().
        I have already seen the program testthread.cpp under the demo/
directory, but it hasn't been helpful. It would be nice to have a manual
besides the brief and technical documentation contained in the doc/
directory.
        Thanks in advance for reading this e-mail.

        Fabi?n.

P.S.

How can I subscribe to this mailing list ?


#include <config.h>
#include <strchar.h>
#include <exception.h>
#include <thread.h>
#include <socket.h>
#include <iostream.h>

#ifdef  CCXX_NAMESPACES
using namespace std;
using namespace ost;
#endif

class MyThread: public Thread
{
        public:
                MyThread( void ) ;
                void Run( void );
};

MyThread::MyThread( void )
{
}

void MyThread::Run( void )
{
        cout << "Hello World" << endl ;
}

void main( void )
{
        MyThread firstthread ;
        firstthread.Start() ;
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]