Branch: Tag:

2020-10-09

2020-10-09 14:48:35 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Startup: Fix race condition in transfer_handler_queue().

Under some circumstances it seems transfer_handler_queue()
can enter into an infinite loop taking 100% cpu.

Fixes [WS-629].

901:      protected void transfer_handler_queue(Queue from, Queue to, int|void count)   { -  int transferred = handle_queue->size(); +  int transferred = from->size();    -  while (array entry = handle_queue->try_read()) { +  while (array entry = from->try_read()) {    if (arrayp(entry)) { -  low_handle_queue->write(entry); +  to->write(entry);    }    }