citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
  Fossies Dox: citadel.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

threads.h
Go to the documentation of this file.
1
2#ifndef THREADS_H
3#define THREADS_H
4
5#include "sysdep.h"
6
7#ifdef HAVE_PTHREAD_H
8#include <pthread.h>
9#endif
10
11#include <sys/time.h>
12#include <string.h>
13
14#include <db.h>
15
16#include "server.h"
17#include "sysdep_decls.h"
18
19/*
20 * Things we need to keep track of per-thread instead of per-session
21 */
22struct thread_tsd {
23 DB_TXN *tid; /* Transaction handle */
24 DBC *cursors[MAXCDB]; /* Cursors, for traversals... */
25};
26
27extern pthread_key_t ThreadKey;
28extern struct thread_tsd masterTSD;
29#define TSD MyThread()
30
31extern int num_workers;
32extern int active_workers;
33extern int server_shutting_down;
34
35struct thread_tsd *MyThread(void);
36int try_critical_section (int which_one);
37void begin_critical_section (int which_one);
38void end_critical_section (int which_one);
39void go_threading(void);
40void InitializeMasterTSD(void);
41void CtdlThreadCreate(void *(*start_routine)(void*));
42
43
44extern pthread_mutex_t ThreadCountMutex;;
45
46#endif // THREADS_H
@ MAXCDB
Definition: server.h:199
DBC * cursors[MAXCDB]
Definition: threads.h:24
DB_TXN * tid
Definition: threads.h:23
void begin_critical_section(int which_one)
Definition: threads.c:67
pthread_key_t ThreadKey
Definition: threads.c:28
void end_critical_section(int which_one)
Definition: threads.c:85
int try_critical_section(int which_one)
Definition: threads.c:49
void InitializeMasterTSD(void)
Definition: threads.c:139
struct thread_tsd masterTSD
Definition: threads.c:30
void CtdlThreadCreate(void *(*start_routine)(void *))
Definition: threads.c:126
pthread_mutex_t ThreadCountMutex
Definition: threads.c:32
int active_workers
Definition: threads.c:27
int server_shutting_down
Definition: threads.c:31
void go_threading(void)
Definition: threads.c:147
struct thread_tsd * MyThread(void)
Definition: threads.c:94
int num_workers
Definition: threads.c:26