place: fix finalizaiton of place channels stuck in a GC'ed channel
Lack of ordering on finalization requires some care for explicit
clean-up actions in a finalizer.
Back-port of commit a5f26013ab
.
This commit is contained in:
parent
129c5ed210
commit
055512590f
|
@ -2957,6 +2957,11 @@ Scheme_Place_Async_Channel *place_async_channel_create() {
|
|||
|
||||
static void async_channel_refcount(Scheme_Place_Async_Channel *ch, int for_send, int delta)
|
||||
{
|
||||
if (!ch->lock) {
|
||||
/* can happen via finalization, where the channel is already finalized
|
||||
(due to the lack of ordering on finalization) */
|
||||
return;
|
||||
}
|
||||
mzrt_mutex_lock(ch->lock);
|
||||
if (for_send)
|
||||
ch->wr_ref += delta;
|
||||
|
|
Loading…
Reference in New Issue
Block a user