Hi,
Can anybody tell me why this program is not running properly.
(see attachment for the program).
The o/p is
Before Thread1 start
Before Thread2 start
Thread1 Initial()
Run() of thread1
Regards,
Seenu.
Note: I am using Common C++ 1.3.2, egcs -2.91.66, and Redhat 6.2 on a
i686 m/c (Kernel 2.2.14)
--
-----------------------------------------------------------------------------
If not here, you can reach me at address@hidden
C-DOT, 71/1, Sneha Complex, Miller Road, Bangalore - 560 052
Ph: 226 3399 Ext: 268 Direct: 238 3951 (Off)
363 1707 (Resi)
------------------------------------------------------------------------
#include <cc++/config.h>
#include <cc++/macros.h>
#include <cc++/thread.h>
#include <cc++/socket.h>
#include <stdlib.h>
#include <stdio.h>
class Thread1 : public Thread
{
private:
void Initial()
{ cout << "Thread1 Initial() " << endl;}
void Run();
void Final()
{ delete this;};
};
class Thread2 : public Thread
{
private:
void Initial()
{ cout << "Thread2 Initial() " << endl;}
void Run();
void Final()
{ delete this;};
};
int main()
{
Thread1 *thread1 = new Thread1;
Thread2 *thread2 = new Thread2;
cout << "Before Thread1 start " << endl;
thread1->Start();
cout << "Before Thread2 start " << endl;
thread2->Start();
}
void Thread1::Run(void)
{
cout << "Run() of thread1" << endl;
}
void Thread2::Run(void)
{
cout << "Run() of thread2" << endl;
}
bug1.cpp
Content-Type:
text/plain
Content-Encoding:
7bit