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