lovely priority inversions

This commit is contained in:
ed 2021-02-12 23:53:13 +01:00
parent 9c03c65e07
commit b8481e32ba

View file

@ -381,6 +381,18 @@ function up2k_init(have_crypto) {
while (true) { while (true) {
var mou_ikkai = false; var mou_ikkai = false;
if (st.todo.handshake.length > 0 &&
st.busy.handshake.length == 0 && (
st.todo.handshake[0].t3 || (
handshakes_permitted() &&
st.busy.upload.length < parallel_uploads
)
)
) {
exec_handshake();
mou_ikkai = true;
}
if (handshakes_permitted() && if (handshakes_permitted() &&
st.todo.handshake.length > 0 && st.todo.handshake.length > 0 &&
st.busy.handshake.length == 0 && st.busy.handshake.length == 0 &&
@ -688,6 +700,8 @@ function up2k_init(have_crypto) {
ebi('f{0}p'.format(t.n)).innerHTML = 'hash {0}, up {1} MB/s'.format( ebi('f{0}p'.format(t.n)).innerHTML = 'hash {0}, up {1} MB/s'.format(
spd1.toFixed(2), spd2.toFixed(2)); spd1.toFixed(2), spd2.toFixed(2));
} }
else t.t3 = undefined;
tasker(); tasker();
} }
else { else {
@ -766,7 +780,7 @@ function up2k_init(have_crypto) {
if (t.postlist.length == 0) { if (t.postlist.length == 0) {
t.t3 = new Date().getTime(); t.t3 = new Date().getTime();
ebi('f{0}t'.format(t.n)).innerHTML = 'verifying'; ebi('f{0}t'.format(t.n)).innerHTML = 'verifying';
st.todo.handshake.push(t); st.todo.handshake.unshift(t);
} }
tasker(); tasker();
} }