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.c File Reference
#include <errno.h>
#include <stdio.h>
#include <syslog.h>
#include <libcitadel.h>
#include "modules_init.h"
#include "serv_extensions.h"
#include "ctdl_module.h"
#include "config.h"
#include "context.h"
#include "threads.h"
Include dependency graph for threads.c:

Go to the source code of this file.


void InitializeSemaphores (void)
int try_critical_section (int which_one)
void begin_critical_section (int which_one)
void end_critical_section (int which_one)
struct thread_tsdMyThread (void)
void * CTC_backend (void *supplied_start_routine)
void CtdlThreadCreate (void *(*start_routine)(void *))
void InitializeMasterTSD (void)
void go_threading (void)


int num_workers = 0
int active_workers = 0
pthread_key_t ThreadKey
pthread_mutex_t Critters [MAX_SEMAPHORES]
struct thread_tsd masterTSD
int server_shutting_down = 0
pthread_mutex_t ThreadCountMutex

Function Documentation

◆ begin_critical_section()

◆ CTC_backend()

void * CTC_backend ( void *  supplied_start_routine)

Definition at line 108 of file threads.c.

References malloc(), and ThreadKey.

Referenced by CtdlThreadCreate().

◆ CtdlThreadCreate()

void CtdlThreadCreate ( void *(*)(void *)  start_routine)

Definition at line 126 of file threads.c.

References CTC_backend(), and THREADSTACKSIZE.

Referenced by go_threading().

◆ end_critical_section()

◆ go_threading()

◆ InitializeMasterTSD()

void InitializeMasterTSD ( void  )

Definition at line 139 of file threads.c.

References masterTSD.

Referenced by main().

◆ InitializeSemaphores()

void InitializeSemaphores ( void  )

Definition at line 34 of file threads.c.

References Critters, and MAX_SEMAPHORES.

◆ MyThread()

struct thread_tsd * MyThread ( void  )

Definition at line 94 of file threads.c.

References masterTSD, and ThreadKey.

◆ try_critical_section()

int try_critical_section ( int  which_one)

Definition at line 49 of file threads.c.

References cdb_check_handles(), Critters, S_FLOORCACHE, and S_NETCONFIGS.

Referenced by dead_session_purge().

Variable Documentation

◆ active_workers

int active_workers = 0

Definition at line 27 of file threads.c.

Referenced by go_threading(), and worker_thread().

◆ Critters

pthread_mutex_t Critters[MAX_SEMAPHORES]

◆ masterTSD

struct thread_tsd masterTSD

Definition at line 30 of file threads.c.

Referenced by InitializeMasterTSD(), and MyThread().

◆ num_workers

int num_workers = 0

Definition at line 26 of file threads.c.

Referenced by go_threading(), and worker_thread().

◆ server_shutting_down

◆ ThreadCountMutex

pthread_mutex_t ThreadCountMutex

Definition at line 32 of file threads.c.

Referenced by go_threading(), and worker_thread().

◆ ThreadKey

pthread_key_t ThreadKey

Definition at line 28 of file threads.c.

Referenced by CTC_backend(), init_sysdep(), and MyThread().