From 5973e1aa9322ae881ec9ee9349639180477bf812 Mon Sep 17 00:00:00 2001 From: Mike Rieker Date: Wed, 12 May 2010 11:58:46 -0400 Subject: [PATCH] watchprops would go to 100% CPU after processing first change original Id: I7992dcb9926f323367899fbdbdec15ab4e5872a4 picked from https://android-review.googlesource.com/#/c/14700/ --- toolbox/watchprops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toolbox/watchprops.c b/toolbox/watchprops.c index d3119924b03..13909940130 100644 --- a/toolbox/watchprops.c +++ b/toolbox/watchprops.c @@ -27,7 +27,7 @@ static void announce(const prop_info *pi) char name[PROP_NAME_MAX]; char value[PROP_VALUE_MAX]; char *x; - + __system_property_read(pi, name, value); for(x = value; *x; x++) { @@ -43,7 +43,7 @@ int watchprops_main(int argc, char *argv[]) unsigned serial = pa->serial; unsigned count = pa->count; unsigned n; - + if(count >= 1024) exit(1); for(n = 0; n < count; n++) { @@ -55,6 +55,7 @@ int watchprops_main(int argc, char *argv[]) do { __futex_wait(&pa->serial, serial, 0); } while(pa->serial == serial); + serial = pa->serial; while(count < pa->count){ watchlist[count].pi = __system_property_find_nth(count);