Index: schedlock.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/schedlock.exp,v retrieving revision 1.3 diff -u -r1.3 schedlock.exp --- schedlock.exp 4 Jan 2003 23:05:05 -0000 1.3 +++ schedlock.exp 23 Apr 2003 18:31:05 -0000 @@ -112,8 +112,8 @@ stop_process "stop all threads ($msg)" - # Make sure we're in one of the looping threads. - gdb_breakpoint [gdb_get_line_number "schedlock.exp: main loop"] + # Make sure we're in one of the non-main looping threads. + gdb_breakpoint [concat [gdb_get_line_number "schedlock.exp: main loop"] " if arg != 5"] gdb_continue_to_breakpoint "return to loop ($msg)" delete_breakpoints } @@ -230,12 +230,11 @@ set start_args $cont_args set cont_args [get_args] +set num_other_threads 0 for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} { if {[lindex $start_args $i] == [lindex $cont_args $i]} { if {$i == $curthread} { fail "current thread stepped (didn't run)" - } else { - fail "other thread $i ran (didn't run) (1)" } } else { if {$i == $curthread} { @@ -245,9 +244,14 @@ fail "current thread stepped (wrong amount)" } } else { - pass "other thread $i ran (1)" + set num_other_threads [expr $num_other_threads + 1] } } +} +if {$num_other_threads > 0} { + pass "other threads ran (1)" +} else { + fail "other threads ran (no other threads ran) (1)" } # Test continue with scheduler locking