nfs-ganesha 1.4
Functions | Variables

nfs_tcb.c File Reference

The file that contain thread control block related code. More...

#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <fcntl.h>
#include "nfs_tcb.h"
#include "nlm_list.h"

Go to the source code of this file.

Functions

void tcb_head_init (void)
void tcb_insert (nfs_tcb_t *element)
void tcb_remove (nfs_tcb_t *element)
int tcb_new (nfs_tcb_t *element, char *name)
void wait_for_threads_to_exit ()
pause_rc _wait_for_threads_to_pause ()
pause_rc wait_for_threads_to_pause ()
pause_rc wait_for_threads_to_awaken ()
void mark_thread_asleep (nfs_tcb_t *wcb)
void mark_thread_done (nfs_tcb_t *wcb)
pause_rc mark_thread_existing (nfs_tcb_t *wcb)
void mark_thread_awake (nfs_tcb_t *wcb)
void notify_threads_of_new_state ()
pause_rc pause_threads (pause_reason_t reason)
pause_rc wake_threads (awaken_reason_t reason)
thread_sm_t thread_sm_locked (nfs_tcb_t *tcbp)

Variables

pthread_mutex_t gtcb_mutex = PTHREAD_MUTEX_INITIALIZER
pthread_cond_t active_threads_cond = PTHREAD_COND_INITIALIZER
unsigned int num_active_threads = 0
unsigned int num_existing_threads = 0
awaken_reason_t awaken_reason = AWAKEN_STARTUP
int num_pauses = 0
pause_state_t pause_state = STATE_STARTUP
const char * pause_reason_str []
const char * awaken_reason_str []
const char * pause_state_str []
const char * pause_rc_str []

Detailed Description

The file that contain thread control block related code.

Author:
Author:
leibovic

nfs_tcb.c : The file that contain thread control block related code

Definition in file nfs_tcb.c.


Function Documentation

pause_rc _wait_for_threads_to_pause ( void  )

Definition at line 152 of file nfs_tcb.c.

void mark_thread_asleep ( nfs_tcb_t wcb)

mark_thread_asleep: Mark a thread as asleep

Definition at line 263 of file nfs_tcb.c.

void mark_thread_awake ( nfs_tcb_t wcb)

mark_thread_awake: Mark a thread as awake

Definition at line 340 of file nfs_tcb.c.

void mark_thread_done ( nfs_tcb_t wcb)

mark_thread_done: Mark a thread as done

Definition at line 286 of file nfs_tcb.c.

pause_rc mark_thread_existing ( nfs_tcb_t wcb)

mark_thread_exist: Mark a thread as existing

Definition at line 311 of file nfs_tcb.c.

void notify_threads_of_new_state ( void  )

Definition at line 359 of file nfs_tcb.c.

pause_rc pause_threads ( pause_reason_t  reason)

pause_threads: Pause threads.

Definition at line 388 of file nfs_tcb.c.

void tcb_head_init ( void  )

Definition at line 87 of file nfs_tcb.c.

void tcb_insert ( nfs_tcb_t element)

Definition at line 92 of file nfs_tcb.c.

int tcb_new ( nfs_tcb_t element,
char *  name 
)

tcb_new: Initialize and insert the new tcb element If no inext to prefix with the name, pass -1.

Definition at line 110 of file nfs_tcb.c.

void tcb_remove ( nfs_tcb_t element)

Definition at line 99 of file nfs_tcb.c.

thread_sm_t thread_sm_locked ( nfs_tcb_t tcbp)

Definition at line 548 of file nfs_tcb.c.

pause_rc wait_for_threads_to_awaken ( void  )

Definition at line 246 of file nfs_tcb.c.

void wait_for_threads_to_exit ( void  )

wait_for_threads_to_exit: Wait for threads to exit

Definition at line 129 of file nfs_tcb.c.

pause_rc wait_for_threads_to_pause ( )

Definition at line 185 of file nfs_tcb.c.

pause_rc wake_threads ( awaken_reason_t  reason)

wake_threads: Wake up threads.

Definition at line 480 of file nfs_tcb.c.


Variable Documentation

pthread_cond_t active_threads_cond = PTHREAD_COND_INITIALIZER

Definition at line 50 of file nfs_tcb.c.

awaken_reason_t awaken_reason = AWAKEN_STARTUP

Definition at line 53 of file nfs_tcb.c.

const char* awaken_reason_str[]
Initial value:
{
  "AWAKEN_STARTUP",
  "AWAKEN_RELOAD_EXPORTS",
}

Definition at line 63 of file nfs_tcb.c.

pthread_mutex_t gtcb_mutex = PTHREAD_MUTEX_INITIALIZER

Definition at line 48 of file nfs_tcb.c.

unsigned int num_active_threads = 0

Definition at line 51 of file nfs_tcb.c.

unsigned int num_existing_threads = 0

Definition at line 52 of file nfs_tcb.c.

int num_pauses = 0

Definition at line 54 of file nfs_tcb.c.

const char* pause_rc_str[]
Initial value:
{
  "PAUSE_OK",
  "PAUSE_AWAKE",
  "PAUSE_PAUSE",
  "PAUSE_EXIT",
}

Definition at line 79 of file nfs_tcb.c.

const char* pause_reason_str[]
Initial value:
{
  "PAUSE_RELOAD_EXPORTS",
  "PAUSE_SHUTDOWN",
}

Definition at line 57 of file nfs_tcb.c.

pause_state_t pause_state = STATE_STARTUP

Definition at line 55 of file nfs_tcb.c.

const char* pause_state_str[]
Initial value:
{
  "STATE_STARTUP",
  "STATE_AWAKEN",
  "STATE_AWAKE",
  "STATE_PAUSE",
  "STATE_PAUSED",
  "STATE_EXIT",
}

Definition at line 69 of file nfs_tcb.c.