pazpar2  1.14.1
sel_thread.h
Go to the documentation of this file.
1 /* This file is part of Pazpar2.
2  Copyright (C) Index Data
3 
4 Pazpar2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8 
9 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 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 St, Fifth Floor, Boston, MA 02110-1301 USA
17 
18 */
19 
20 #ifndef SEL_THREAD_H
21 #define SEL_THREAD_H
22 #include <yaz/yconfig.h>
23 
24 YAZ_BEGIN_CDECL
25 
27 typedef struct sel_thread *sel_thread_t;
28 
41 sel_thread_t sel_thread_create(void (*work_handler)(void *work_data),
42  void (*work_destroy)(void *work_data),
43  int *read_fd, int no_of_threads);
44 
49 
54 void sel_thread_add(sel_thread_t p, void *data);
55 
61 
62 YAZ_END_CDECL
63 
64 
65 #endif
66 
67 
68 /*
69  * Local variables:
70  * c-basic-offset: 4
71  * c-file-style: "Stroustrup"
72  * indent-tabs-mode: nil
73  * End:
74  * vim: shiftwidth=4 tabstop=8 expandtab
75  */
76 
static void work_handler(void *work_data)
Definition: eventl.c:228
struct sel_thread * sel_thread_t
select thread handler type
Definition: sel_thread.h:27
void * sel_thread_result(sel_thread_t p)
gets result of work
Definition: sel_thread.c:230
void sel_thread_add(sel_thread_t p, void *data)
adds work to be carried out in thread
Definition: sel_thread.c:205
sel_thread_t sel_thread_create(void(*work_handler)(void *work_data), void(*work_destroy)(void *work_data), int *read_fd, int no_of_threads)
creates select thread
Definition: sel_thread.c:129
void sel_thread_destroy(sel_thread_t p)
destorys select thread
Definition: sel_thread.c:182
int read_fd
Definition: sel_thread.c:66
static void work_destroy(void *vp)
how work is destructed