Skip to content

Commit

Permalink
Merge "watchprops would go to 100% CPU after processing first change"…
Browse files Browse the repository at this point in the history
… into gingerbread
  • Loading branch information
maniac103 authored and Gerrit Code Review committed Sep 18, 2012
2 parents 6977c11 + 5973e1a commit fcc79e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions toolbox/watchprops.c
Expand Up @@ -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++) {
Expand All @@ -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++) {
Expand All @@ -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);
Expand Down

0 comments on commit fcc79e6

Please sign in to comment.