3 * Copyright (C) 2003 and beyond by Alexander Strange
4 * and the Dawn Of Infinity developers.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * This license is contained in the file "COPYING",
17 * which is included with this source code; it is available online at
18 * http://www.gnu.org/licenses/gpl.html
30 #include <sys/types.h>
32 typedef struct queue {
38 pthread_rwlock_t pmutex;
41 typedef void (*qperformer) (void *context, void *p);
43 extern queue *qinit(queue *q,size_t defaultsize);
44 extern void qdel(queue *q);
45 extern void *qpop(queue *q);
46 extern void qpush(queue *q, void *p);
47 extern size_t growarray(void ***datap, size_t oldsize);
48 extern void qperform(queue *q, qperformer p, void *pctx);