diff options
author | Dick Porter <dick@acm.org> | 2007-02-21 19:45:39 +0300 |
---|---|---|
committer | Dick Porter <dick@acm.org> | 2007-02-21 19:45:39 +0300 |
commit | e68e73c7efe7a4e28028d3c0a8c43842caf6dc21 (patch) | |
tree | 0b47080b2e605d48385fee50862feb6649be4c3f | |
parent | 6b2181df333da3201aa21e7aac7af0092a95f155 (diff) |
2007-02-16 Dick Porter <dick@ximian.com>mono-1-2-3
* threadpool.c (append_job): Fix fast-path array handling, so it's
less likely the array will grow exponentially when the load is
heavy.
svn path=/branches/mono-1-2-3/mono/; revision=73260
-rw-r--r-- | mono/metadata/ChangeLog | 6 | ||||
-rw-r--r-- | mono/metadata/threadpool.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog index bda10e35eea..4a483382c50 100644 --- a/mono/metadata/ChangeLog +++ b/mono/metadata/ChangeLog @@ -1,3 +1,9 @@ +2007-02-16 Dick Porter <dick@ximian.com> + + * threadpool.c (append_job): Fix fast-path array handling, so it's + less likely the array will grow exponentially when the load is + heavy. + Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com> * loader.c: implemented typedef parent in field memberref. diff --git a/mono/metadata/threadpool.c b/mono/metadata/threadpool.c index e334cbc220f..f7367a0a3bf 100644 --- a/mono/metadata/threadpool.c +++ b/mono/metadata/threadpool.c @@ -1120,7 +1120,7 @@ static void append_job (CRITICAL_SECTION *cs, TPQueue *list, MonoObject *ar) { EnterCriticalSection (cs); - if (list->array && mono_array_length (list->array) < list->next_elem) { + if (list->array && (list->next_elem < mono_array_length (list->array))) { mono_array_setref (list->array, list->next_elem, ar); list->next_elem++; LeaveCriticalSection (cs); |