mirror of
https://github.com/janet-lang/janet
synced 2026-09-20 00:00:41 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user