Project

General

Profile

Bug #18818 » 0001-Mark-Fibers-in-Mutex-Queue-SizedQueue-wait-lists.patch

nevans (Nicholas Evans), 06/06/2022 06:30 PM

View differences:

thread_sync.c
sync_wakeup(head, LONG_MAX);
}
static void
mark_all(struct ccan_list_head *head)
{
struct sync_waiter *waiter = 0;
ccan_list_for_each(head, waiter, node) {
/* don't need to handle compact. this code isn't storing a VALUE */
rb_gc_mark_movable(rb_fiberptr_self(waiter->fiber));
}
}
#if defined(HAVE_WORKING_FORK)
static void rb_mutex_abandon_all(rb_mutex_t *mutexes);
static void rb_mutex_abandon_keeping_mutexes(rb_thread_t *th);
......
*
*/
#define mutex_mark ((void(*)(void*))0)
static void
mutex_mark (void *ptr)
{
rb_mutex_t *mutex = ptr;
mark_all(&mutex->waitq);
}
static size_t
rb_mutex_num_waiting(rb_mutex_t *mutex)
......
{
struct rb_queue *q = ptr;
/* no need to mark threads in waitq, they are on stack */
mark_all(queue_waitq(q));
rb_gc_mark(q->que);
}
......
szqueue_mark(void *ptr)
{
struct rb_szqueue *sq = ptr;
mark_all(szqueue_pushq(sq));
queue_mark(&sq->q);
}
(3-3/4)