--Boundary-00BC+Fp80P4dtcz0 Content-Type: text/plain; charset tf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline > > The fix is in thread-mutex-remove_one.diff. > > Perhaps you attached the wrong file? This looks like a variation on the > not_owner patch. Yup. Here is the right one. I now have problems with ConditionVariable#wait complaining that the mutex is not owned while it is ... Trying to fix that now. Sylvain --Boundary-00BC+Fp80P4dtcz0 Content-Type: text/x-diff; charset tf-8"; name hread-mutex-remove_one.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename hread-mutex-remove_one.diff" --- /home/sjoyeux/system/ruby-1.8.6/ext/thread/thread.c 2007-03-03 11:08:06.000000000 +0100 +++ thread.c 2007-03-14 17:12:38.000000000 +0100 @@ -165,12 +165,23 @@ remove_one(List *list, VALUE value) Entry **ref; Entry *entry; - for (ref list->entries, entry ist->entries; - entry ! ULL; - ref entry->next, entry ntry->next) { - if (entry->value value) { - *ref ntry->next; - recycle_entries(list, entry, entry); + entry ist->entries; + if (!entry) return; + if (entry->value value) + { + shift_list(list); + return; + } + + for (entry ist->entries; entry->next ! ULL; entry ntry->next) { + Entry* next_entry ntry->next; + if (next_entry->value value) { + entry->next ext_entry->next; + if (!entry->next) + list->last_entry ntry; + + --list->size; + recycle_entries(list, next_entry, next_entry); break; } } --Boundary-00BC+Fp80P4dtcz0--