9PQUEUE(2)                                             9PQUEUE(2)

     NAME
          Reqqueue, reqqueuecreate, reqqueuepush, reqqueueflush -
          deferred processing of 9P requests

     SYNOPSIS
          #include <u.h>
          #include <libc.h>
          #include <fcall.h>
          #include <thread.h>
          #include <9p.h>

          struct Reqqueue
          {
               ...
          };

          Reqqueue*    reqqueuecreate(void);
          void         reqqueuepush(Reqqueue *q, Req *r, void (*f)(Req *));
          void         reqqueueflush(Reqqueue *q, Req *r);
          void         reqqueuefree(Reqqueue *q);

     DESCRIPTION
          Reqqueue provides routines for deferred processing of 9p
          request in multithreaded 9p servers.

          The reqqueuecreate function spawns a process for handling
          requests returning a pointer to the Reqqueue structure allo-
          cated.

          To schedule a request to be processed on a queue,
          reqqueuepush is called with request r and its handler func-
          tion f.

          A previously submitted request can be flushed from a queue
          by reqqueueflush which will remove the request immediately
          if processing has not started. If processing has been
          started, the process will be interrupted.

          Reqqueuefree frees a queue.  No new requests should be send
          to the queue and it will be freed once all requests in it
          have been processed.

     SOURCE
          /sys/src/lib9p/queue.c

     SEE ALSO
          9p(2)