Suspicious locking behavior with select.

This looks like it could cause deadlocks with threaded channels
(normal channels are unaffected, locking/unlocking is a no-op).
This commit is contained in:
Calvin Rose
2026-02-20 07:35:18 -06:00
parent ea997d585b
commit 56b5998553
+2
View File
@@ -1249,6 +1249,7 @@ JANET_CORE_FN(cfun_channel_choice,
chan_unlock_args(argv, i);
return make_write_result(chan);
}
janet_chan_unlock(chan);
} else {
/* Read */
JanetChannel *chan = janet_getchannel(argv, i);
@@ -1264,6 +1265,7 @@ JANET_CORE_FN(cfun_channel_choice,
chan_unlock_args(argv, i);
return make_read_result(chan, item);
}
janet_chan_unlock(chan);
}
}