summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-22 12:02:38 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-22 12:02:38 +0000
commit9ff0555a1ee8644b165e79895068b6713fdf9bc9 (patch)
tree7206727e1fed5a696c7a036dde8f7975142fd398 /ext
parent8ad16ae4d7a747301595d807dfb891b1d634a934 (diff)
merge -c 12113
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@12306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/thread/thread.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/thread/thread.c b/ext/thread/thread.c
index d617185..b0badf1 100644
--- a/ext/thread/thread.c
+++ b/ext/thread/thread.c
@@ -163,13 +163,18 @@ static void
remove_one(List *list, VALUE value)
{
Entry **ref;
+ Entry *prev;
Entry *entry;
- for (ref = &list->entries, entry = list->entries;
+ for (ref = &list->entries, prev = NULL, entry = list->entries;
entry != NULL;
- ref = &entry->next, entry = entry->next) {
+ ref = &entry->next, prev = entry, entry = entry->next) {
if (entry->value == value) {
*ref = entry->next;
+ list->size--;
+ if (!entry->next) {
+ list->last_entry = prev;
+ }
recycle_entries(list, entry, entry);
break;
}