File th/thread.c

  $Revision: 1.29 $

Example code: A thread.
Status: NOT REVUED, NOT TESTED
Authors: Chris Ottrey Joao Damas
Online References:

Included Files


Global Variable Lock

pthread_mutex_t Lock
Included from /home/shane/code/RIP/include/ca_defs.h
Visible in:  aa/aa.c
   ac/access_control.c
   ca/ca_configFns.c
   ca/ca_initFn.c
   ca/ca_sanityCheck.c
   ca/ca_sourceLoader.c
   ca/ca_values.c
   co/constants.c
   df/defs.c
   er/er.c
   er/er_arrays.c
   er/er_macro.c
   er/er_paths.c
   er/er_print.c
   ip/ip.c
   ma/bitmask.c
   mm/mm.c
   nh/nh.c
   pa/gpg.c
   pa/spawn.c
   pc/pc_commands.c
   pc/protocol_config.c
   pm/pm_serials.c
   pm/protocol_mirror.c
   pr/properties.c
   pw/protocol_whois.c
   qc/mg_getopt.c
   qc/query_command.c
   qi/query_instructions.c
   rp/rp_convert.c
   rp/rp_load.c
   rp/rp_search.c
   rp/rp_tree.c
   rp/rp_update.c
   rx/rx_node.c
   rx/rx_print.c
   rx/rx_search.c
   rx/rx_tree.c
   sk/cd_socket.c
   sk/cd_watchdog.c
   sk/sk_socket.c
   sq/mysql_driver.c
   sv/server.c
   ta/ta.c
   th/thread.c
Used in: ca_get_adminIntElement()ca/ca_configFns.c
  ca_get_adminStrElement()ca/ca_configFns.c
  ca_get_boolean()ca/ca_configFns.c
  ca_get_dirlist()ca/ca_configFns.c
  ca_get_int()ca/ca_configFns.c
  ca_get_string()ca/ca_configFns.c
  ca_set_boolean()ca/ca_configFns.c
  ca_srchandle2Intelement()ca/ca_configFns.c
  ca_srchandle2Strelement()ca/ca_configFns.c

Global Function TH_acquire_read_lock()

  Aquire a readers lock.

Reference: "Multithreaded Programming Techniques - Prasad p.192" More:
  Author:
        ottrey
void TH_acquire_read_lock ( rw_lock_t* prw_lock )
rw_lock_t* prw_lock
Readers writers lock.
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_cond_wait(), pthread_mutex_lock(), pthread_mutex_unlock()
Called by: AC_check_acl()ac/access_control.c
  ER_is_traced()er/er.c
  ER_macro_list()er/er_macro.c
  er_logit()er/er.c

Global Function TH_acquire_read_lockw()

  Aquire a readers lock.

Reference: "Multithreaded Programming Techniques - Prasad p.192" More:
  Author:
        ottrey
void TH_acquire_read_lockw ( rw_lock_t* prw_lock )
rw_lock_t* prw_lock
Readers writers lock.
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_cond_wait(), pthread_mutex_lock(), pthread_mutex_unlock()
Called by: PW_record_query_start()pw/protocol_whois.c
  RP_asc_search()rp/rp_search.c
  RP_tree_get()rp/rp_tree.c

Global Function TH_acquire_write_lock()

  Aquire a writers lock.

Reference: "Multithreaded Programming Techniques - Prasad p.192" More:
  Author:
        ottrey
void TH_acquire_write_lock ( rw_lock_t* prw_lock )
rw_lock_t* prw_lock
Readers writers lock.
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_cond_wait(), pthread_mutex_lock(), pthread_mutex_unlock()
Called by: AC_acc_load()ac/access_control.c
  AC_asc_all_set()ac/access_control.c
  AC_asc_set_nodeny()ac/access_control.c
  AC_ban_set()ac/access_control.c
  AC_commit()ac/access_control.c
  AC_decay()ac/access_control.c
  AC_fetch_acc()ac/access_control.c
  ER_make_macro()er/er_macro.c
  ER_process_split()er/er_macro.c

Global Function TH_acquire_write_lockw()

  Aquire a writers lock.

Reference: "Multithreaded Programming Techniques - Prasad p.192" More:
  Author:
        ottrey
void TH_acquire_write_lockw ( rw_lock_t* prw_lock )
rw_lock_t* prw_lock
Readers writers lock.
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_cond_wait(), pthread_mutex_lock(), pthread_mutex_unlock()
Called by: PW_stopqueries()pw/protocol_whois.c
  RP_tree_add()rp/rp_tree.c
  RP_uni_node()rp/rp_update.c

Global Function TH_create()

  This is the routine that creates a thread. 

More:
  Author:
        ottrey
	joao
	andrei
pthread_t TH_create ( void* do_function(void*), void* arguments )
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: fprintf(), pthread_attr_destroy(), pthread_attr_getstacksize(), pthread_attr_init(), pthread_attr_setdetachstate(), pthread_attr_setstacksize(), pthread_create()
Called by: SV_concurrent_server()sv/server.c
  SV_start()sv/server.c
  main_loop()sv/server.c

Global Function TH_get_id()

int TH_get_id ( void )
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_self()

Global Function TH_init_read_write_lock()

  Initialize a readers/writers lock.

Side effect: the lock is set to open(?)
Reference: "Multithreaded Programming Techniques - Prasad p.192" More:
  Author:
        ottrey
void TH_init_read_write_lock ( rw_lock_t* prw_lock )
rw_lock_t* prw_lock
Readers writers lock.
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_cond_init(), pthread_mutex_init()
Called by: ER_init()er/er.c

Global Function TH_init_read_write_lockw()

  Initialize a readers/writers lock.

Side effect: the lock is set to open(?)
Reference: "Multithreaded Programming Techniques - Prasad p.192" More:
  Author:
        ottrey
void TH_init_read_write_lockw ( rw_lock_t* prw_lock )
rw_lock_t* prw_lock
Readers writers lock.
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_cond_init(), pthread_mutex_init()
Called by: PW_init()pw/protocol_whois.c
  RX_tree_cre()rx/rx_tree.c
  radix_init()sv/server.c

Global Function TH_release_read_lock()

  Release a readers lock.

Reference: "Multithreaded Programming Techniques - Prasad p.192" More:
  Author:
        ottrey
void TH_release_read_lock ( rw_lock_t* prw_lock )
rw_lock_t* prw_lock
Readers writers lock.
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_cond_signal(), pthread_mutex_lock(), pthread_mutex_unlock()
Called by: AC_check_acl()ac/access_control.c
  ER_is_traced()er/er.c
  ER_macro_list()er/er_macro.c
  er_logit()er/er.c

Global Function TH_release_read_lockw()

  Release a readers lock.

Reference: "Multithreaded Programming Techniques - Prasad p.192" More:
  Author:
        ottrey
void TH_release_read_lockw ( rw_lock_t* prw_lock )
rw_lock_t* prw_lock
Readers writers lock.
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_cond_signal(), pthread_mutex_lock(), pthread_mutex_unlock()
Called by: PW_record_query_end()pw/protocol_whois.c
  RP_asc_search()rp/rp_search.c
  RP_tree_get()rp/rp_tree.c

Global Function TH_release_write_lock()

  Release a writers lock.

Reference: "Multithreaded Programming Techniques - Prasad p.192" More:
  Author:
        ottrey
void TH_release_write_lock ( rw_lock_t* prw_lock )
rw_lock_t* prw_lock
Readers writers lock.
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_cond_broadcast(), pthread_mutex_lock(), pthread_mutex_unlock()
Called by: AC_acc_load()ac/access_control.c
  AC_asc_all_set()ac/access_control.c
  AC_asc_set_nodeny()ac/access_control.c
  AC_ban_set()ac/access_control.c
  AC_commit()ac/access_control.c
  AC_decay()ac/access_control.c
  AC_fetch_acc()ac/access_control.c
  ER_make_macro()er/er_macro.c
  ER_process_split()er/er_macro.c

Global Function TH_release_write_lockw()

  Release a writers lock.

Reference: "Multithreaded Programming Techniques - Prasad p.192" More:
  Author:
        ottrey
void TH_release_write_lockw ( rw_lock_t* prw_lock )
rw_lock_t* prw_lock
Readers writers lock.
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: pthread_cond_broadcast(), pthread_mutex_lock(), pthread_mutex_unlock()
Called by: PW_startqueries()pw/protocol_whois.c
  RP_sql_load_attr_space()rp/rp_load.c
  RP_tree_add()rp/rp_tree.c
  RP_uni_node()rp/rp_update.c

Global Function TH_to_string()

char* TH_to_string ( void )
Prototyped in: /home/shane/code/RIP/include/thread.h
Calls: UT_strdup_real(), pthread_self(), sprintf(), strcat(), strcpy()

Local Function asctime_r()

static char* asctime_r ( const struct tm* __tm, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_asctime_r()

Local Function ctime_r()

static char* ctime_r ( const time_t* __time, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_ctime_r()

Local Function getlogin_r()

static int getlogin_r ( char* __name, int __len )
Included from: /usr/include/unistd.h
Calls: __posix_getlogin_r()

Local Function readdir_r()

static int readdir_r ( DIR* __dp, struct dirent* __ent, struct dirent** __res )
Included from: /usr/include/dirent.h
Calls: __posix_readdir_r()

Local Function sigwait()

static int sigwait ( const sigset_t* __setp, int* __signo )
Included from: /usr/include/signal.h
Calls: __posix_sigwait()

Local Function ttyname_r()

static int ttyname_r ( int __fildes, char* __buf, size_t __size )
Included from: /usr/include/unistd.h
Calls: __posix_ttyname_r()