"Fossies" - the Fresh Open Source Software Archive

Member "citadel/threads.h" (5 Jun 2021, 943 Bytes) of package /linux/www/citadel.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "threads.h" see the Fossies "Dox" file reference documentation.

    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  */
   22 struct thread_tsd {
   23     DB_TXN *tid;            /* Transaction handle */
   24     DBC *cursors[MAXCDB];   /* Cursors, for traversals... */
   25 };
   26 
   27 extern pthread_key_t ThreadKey;
   28 extern struct thread_tsd masterTSD;
   29 #define TSD MyThread()
   30 
   31 extern int num_workers;
   32 extern int active_workers;
   33 extern int server_shutting_down;
   34 
   35 struct thread_tsd *MyThread(void);
   36 int try_critical_section (int which_one);
   37 void begin_critical_section (int which_one);
   38 void end_critical_section (int which_one);
   39 void go_threading(void);
   40 void InitializeMasterTSD(void);
   41 void CtdlThreadCreate(void *(*start_routine)(void*));
   42 
   43 
   44 extern pthread_mutex_t ThreadCountMutex;;
   45 
   46 #endif // THREADS_H