void SerialEcho::run() { char* s = new char[getBufferSize()]; cout << "start monitor" << endl;
while (s[0] != 'X') { while (isPending(Serial::pendingInput)) { cout.put( TTYStream::get() ); } sleep(500); } cout << "end of monitor" << endl; delete [] s; exit(); } What's the point of "while (s[0] != 'X')" when "s[0]" is never modified? What's the point of polling "isPending" in a loop? Doesn't that defeat the very purpose of threading? What are reasons this implementation won't work: void SerialEcho::run( ) { cout << "start monitor" << endl; int data; while ( ( data = TTYStream::get( ) ) != 'X' ) { cout.put( data ); } cout << "end of monitor" << endl; exit(); } _______________________________________________ Bug-commoncpp mailing list Bug-commoncpp@gnu.org http://lists.gnu.org/mailman/listinfo/bug-commoncpp