X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ucw%2Fthreads.h;h=89d9f65c19020bba1959d2f7d428f482ea16702b;hb=da418321735b159f0ff39366d68203c772f152d4;hp=7f100b20b2dc79882fb11a4f03250022f560a44b;hpb=30680da0fe1192be08f2ff02d912e3b8a0f1212f;p=libucw.git diff --git a/ucw/threads.h b/ucw/threads.h index 7f100b20..89d9f65c 100644 --- a/ucw/threads.h +++ b/ucw/threads.h @@ -1,14 +1,16 @@ /* * The UCW Library -- Threading Helpers * - * (c) 2006--2010 Martin Mares + * (c) 2006--2012 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. */ -#ifndef _UCW_THREAD_H -#define _UCW_THREAD_H +#ifndef _UCW_THREADS_H +#define _UCW_THREADS_H + +#include /* This structure holds per-thread data */ @@ -17,6 +19,12 @@ struct ucwlib_context { int temp_counter; // Counter for fb-temp.c struct asio_queue *io_queue; // Async I/O queue for fb-direct.c ucw_sighandler_t *signal_handlers; // Signal handlers for sighandler.c + struct main_context *main_context; // Current context for mainloop.c + struct cf_context *cf_context; // Current context for configuration parser + // Resources and transactions: + struct respool *current_respool; // Current resource pool + struct mempool *trans_pool; // Transaction mempool + struct trans *current_trans; // Currently open transaction }; #ifdef CONFIG_UCW_THREADS @@ -41,8 +49,8 @@ extern uns ucwlib_thread_stack_size; /* We have no threads, let's simulate the context and locking */ -extern struct ucwlib_context default_ucwlib_context; -static inline struct ucwlib_context *ucwlib_thread_context(void) { return &default_ucwlib_context; } +extern struct ucwlib_context ucwlib_default_context; +static inline struct ucwlib_context *ucwlib_thread_context(void) { return &ucwlib_default_context; } static inline int ucwlib_thread_id(struct ucwlib_context *c UNUSED) { return 0; }