]> mj.ucw.cz Git - libucw.git/blob - ucw/threads.h
The big move. Step #1: Move whole lib/ to ucw/.
[libucw.git] / ucw / threads.h
1 /*
2  *      The UCW Library -- Threading Helpers
3  *
4  *      (c) 2006 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #ifndef _UCW_THREAD_H
11 #define _UCW_THREAD_H
12
13 /* This structure holds per-thread data */
14
15 struct ucwlib_context {
16   int thread_id;                        // Thread ID (either kernel tid or a counter)
17   int temp_counter;                     // Counter for fb-temp.c
18   struct asio_queue *io_queue;          // Async I/O queue for fb-direct.c
19   sh_sighandler_t *signal_handlers;     // Signal handlers for sighandler.c
20 };
21
22 struct ucwlib_context *ucwlib_thread_context(void);
23
24 /* Global lock used for initialization, cleanup and other not so frequently accessed global state */
25
26 void ucwlib_lock(void);
27 void ucwlib_unlock(void);
28
29 #ifdef CONFIG_UCW_THREADS
30
31 extern uns default_thread_stack_size;
32
33 #endif
34
35 #endif