LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-09-2006, 03:55 AM   #1
lucky6969b
Member
 
Registered: Nov 2005
Posts: 337

Rep: Reputation: 30
Return of State in a thread


Hi,
I've a monitor thread established, and then there is a loop that is watching is serial port. After all data has been read, how do I set it back to monitor state?

I asked this because my thread keeps looping and keeps getting garbage data after reading 1-2 times of valid data. I'm sure the program has broken from the loop. But the loop is entered again without another interrupt coming from the serial port.

I might be missing something. But if you can see the potential logic error is, please post.

Thanks in advance
Jack
 
Old 01-09-2006, 10:12 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Any chance you can post the code? Providing you are actually getting out of the read loop I'm guessing the problem is your logic for going back into the read loop....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
More detailed thread state than open/closed jonaskoelker LQ Suggestions & Feedback 9 06-15-2005 09:36 PM
[thread control suggestion] add a "solved" button that the thread starter can click atom LQ Suggestions & Feedback 3 03-24-2005 11:55 AM
can thread return a local variable? iclinux Programming 1 01-13-2005 11:37 PM
Main thread sending notification to child thread rajesh_b Programming 1 09-22-2004 09:15 AM
configure qt thread issue (just compiled qt w/ -thread option) cleff Linux - Software 8 05-07-2004 11:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration