MINOR: applet: rename applet_runq to applet_active_queue
This is not a real run queue and we're facing ugly bugs because if this : if a an applet removes another applet from the queue, typically the next one after itself, the list iterator loops forever because the list's backup pointer is not valid anymore. Before creating a run queue, let's rename this list.
This commit is contained in:
parent
9bb49f6906
commit
64bca9d36a
|
@ -29,7 +29,7 @@
|
|||
#include <types/applet.h>
|
||||
#include <proto/connection.h>
|
||||
|
||||
extern struct list applet_runq;
|
||||
extern struct list applet_active_queue;
|
||||
|
||||
void applet_run_active();
|
||||
|
||||
|
@ -75,7 +75,7 @@ static inline void appctx_free(struct appctx *appctx)
|
|||
static inline void appctx_wakeup(struct appctx *appctx)
|
||||
{
|
||||
if (LIST_ISEMPTY(&appctx->runq))
|
||||
LIST_ADDQ(&applet_runq, &appctx->runq);
|
||||
LIST_ADDQ(&applet_active_queue, &appctx->runq);
|
||||
}
|
||||
|
||||
/* removes an applet from the list of active applets */
|
||||
|
|
|
@ -19,14 +19,14 @@
|
|||
#include <proto/stream.h>
|
||||
#include <proto/stream_interface.h>
|
||||
|
||||
struct list applet_runq = LIST_HEAD_INIT(applet_runq);
|
||||
struct list applet_active_queue = LIST_HEAD_INIT(applet_active_queue);
|
||||
|
||||
void applet_run_active()
|
||||
{
|
||||
struct appctx *curr, *back;
|
||||
struct stream_interface *si;
|
||||
|
||||
list_for_each_entry_safe(curr, back, &applet_runq, runq) {
|
||||
list_for_each_entry_safe(curr, back, &applet_active_queue, runq) {
|
||||
si = curr->owner;
|
||||
|
||||
/* now we'll need a buffer */
|
||||
|
|
|
@ -1524,7 +1524,7 @@ void run_poll_loop()
|
|||
break;
|
||||
|
||||
/* expire immediately if events are pending */
|
||||
if (fd_cache_num || run_queue || signal_queue_len || !LIST_ISEMPTY(&applet_runq))
|
||||
if (fd_cache_num || run_queue || signal_queue_len || !LIST_ISEMPTY(&applet_active_queue))
|
||||
next = now_ms;
|
||||
|
||||
/* The poller will ensure it returns around <next> */
|
||||
|
|
Loading…
Reference in New Issue