A message for Linux.com registered users: We are in the process of making changes to the Linux forums. Starting Monday, 8/13/18 at 6:00 PM PT, you will be unable to access the forums. They will re-launch as soon as possible on Wednesday, 8/15/18 with new features and improved functionality. Thank you for your patience and stay tuned for the new improved forums.

August 2, 2015

Why posix thread is running only once ?

Hi,
I have problem regarding executing thread program.

I develop a robot for that m using concept of threading for creating a real time scenario to avoid obstacle and sense smoke in the premises.

So the issue is, it runs only in the starting, after that it get disappear..
here is the code skeleton,

void *thread1()
{
while(smoke_detect()==1 || obstacle()==1)
{
stop the robot;
}
}

Please reply me,

Thanking you in advance,

Regards,
Nitin Patil

Click Here!