Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Paste Description for Something

Makes the buffering thread know when a handle has been added. That way it can fill the buffer appropriately.

Something
Monday, February 11th, 2008 at 1:08:25am UTC 

  1. diff --git a/apps/buffering.c b/apps/buffering.c
  2. index 2d7ca22..0b40637 100644
  3. --- a/apps/buffering.c
  4. +++ b/apps/buffering.c
  5. @@ -177,6 +177,8 @@ enum {
  6.      Q_SET_WATERMARK,
  7.      Q_START_FILL,        /* Request that the buffering thread initiate a buffer
  8.                              fill at its earliest convenience */
  9. +    Q_HANDLE_ADDED,      /* Inform the buffering thread that a handle was added
  10. +                            and that it has data needed to be buffered */
  11.  };
  12.  
  13.  /* Buffering thread */
  14. @@ -936,6 +938,10 @@ int bufopen(const char *file, size_t offset, enum data_type type)
  15.          /* Other types will get buffered in the course of normal operations */
  16.          h->fd = -1;
  17.          close(fd);
  18. +
  19. +        /* Inform the buffering thread that we added a handle */
  20. +        LOGFQUEUE("buffering > Q_HANDLE_ADDED %d", h->id);
  21. +        queue_post(&buffering_queue, Q_HANDLE_ADDED, h->id);
  22.      }
  23.  
  24.      logf("bufopen: new hdl %d", h->id);
  25. @@ -1358,6 +1364,11 @@ void buffering_thread(void)
  26.                  queue_reply(&buffering_queue, close_handle((int)ev.data));
  27.                  break;
  28.  
  29. +            case Q_HANDLE_ADDED:
  30. +                LOGFQUEUE("buffering < Q_HANDLE_ADDED");
  31. +                filling = true;
  32. +                break;
  33. +
  34.              case Q_BASE_HANDLE:
  35.                  LOGFQUEUE("buffering < Q_BASE_HANDLE");
  36.                  base_handle_id = (int)ev.data;

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right
worth-right