* linux-nat.c (count_events_callback, select_event_lwp_callback): Only

report events from resumed threads.

	* gdb.threads/schedlock.exp (get_args): Update to work for any
	value of NUM.
	(Top level): Report the number of threads that did not resume.
This commit is contained in:
Daniel Jacobowitz 2008-07-27 21:05:37 +00:00
parent 6387b45f80
commit e09490f18a
4 changed files with 32 additions and 10 deletions

View file

@ -2319,8 +2319,8 @@ count_events_callback (struct lwp_info *lp, void *data)
gdb_assert (count != NULL);
/* Count only LWPs that have a SIGTRAP event pending. */
if (lp->status != 0
/* Count only resumed LWPs that have a SIGTRAP event pending. */
if (lp->status != 0 && lp->resumed
&& WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP)
(*count)++;
@ -2347,8 +2347,8 @@ select_event_lwp_callback (struct lwp_info *lp, void *data)
gdb_assert (selector != NULL);
/* Select only LWPs that have a SIGTRAP event pending. */
if (lp->status != 0
/* Select only resumed LWPs that have a SIGTRAP event pending. */
if (lp->status != 0 && lp->resumed
&& WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP)
if ((*selector)-- == 0)
return 1;