wqueue.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. Copyright (c) 2007, 2008, Sun Microsystems, Inc,
  3. Copyright (c) 2011, 2012, Monty Program Ab
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; version 2 of the License.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  14. #ifndef WQUEUE_INCLUDED
  15. #define WQUEUE_INCLUDED
  16. #include <my_global.h>
  17. #include <my_pthread.h>
  18. /* info about requests in a waiting queue */
  19. typedef struct st_pagecache_wqueue
  20. {
  21. struct st_my_thread_var *last_thread; /* circular list of waiting
  22. threads */
  23. } WQUEUE;
  24. void wqueue_link_into_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
  25. void wqueue_unlink_from_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
  26. void wqueue_add_to_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
  27. void wqueue_add_and_wait(WQUEUE *wqueue,
  28. struct st_my_thread_var *thread,
  29. mysql_mutex_t *lock);
  30. void wqueue_release_queue(WQUEUE *wqueue);
  31. void wqueue_release_one_locktype_from_queue(WQUEUE *wqueue);
  32. #endif