Kannel: Open Source WAP and SMS gateway
svn-r5336
|
#include "gw-config.h"
Go to the source code of this file.
Macros | |
#define | MAIN_THREAD_ID 0 |
#define | gwthread_create(func, arg) (gwthread_create_real(func, __FILE__ ":" #func, arg)) |
Typedefs | |
typedef void | gwthread_func_t(void *arg) |
Functions | |
void | gwthread_init (void) |
void | gwthread_shutdown (void) |
long | gwthread_create_real (gwthread_func_t *func, const char *funcname, void *arg) |
void | gwthread_join (long thread) |
void | gwthread_join_every (gwthread_func_t *func) |
void | gwthread_join_all (void) |
long | gwthread_self (void) |
long | gwthread_self_pid (void) |
void | gwthread_self_ids (long *tid, long *pid) |
void | gwthread_wakeup (long thread) |
void | gwthread_wakeup_all (void) |
int | gwthread_pollfd (int fd, int events, double timeout) |
int | gwthread_poll (struct pollfd *fds, long numfds, double timeout) |
void | gwthread_sleep (double seconds) |
void | gwthread_sleep_micro (double dseconds) |
int | gwthread_cancel (long thread) |
int | gwthread_shouldhandlesignal (int signal) |
int | gwthread_dumpsigmask (void) |
#define gwthread_create | ( | func, | |
arg | |||
) | (gwthread_create_real(func, __FILE__ ":" #func, arg)) |
Definition at line 90 of file gwthread.h.
Referenced by accept_thread(), add_service(), fdset_create_real(), gw_timerset_create(), heartbeat_start(), httpadmin_start(), httpd_emu_create(), init_smsbox(), main(), main_for_producer_and_consumer(), radius_acct_init(), receive_smpp_thread(), run_smppbox(), run_smsbox(), run_sqlbox(), run_wapbox(), smpp_emu(), smpp_emu_handle_pdu(), smsbox_start(), smsc2_start(), smsc_at2_create(), smsc_cgw_create(), smsc_cimd2_create(), smsc_emi2_create(), smsc_emu_create(), smsc_fake_create(), smsc_http_create(), smsc_oisd_create(), smsc_smasi_create(), smsc_smpp_create(), smsc_soap_create(), smsc_wrapper_create(), soap_server_start(), soap_start_cb(), sql_to_bearerbox(), sqlboxc_run(), start_client_threads(), start_http_thread(), start_server_thread(), start_wap(), store_file_load(), timers_init(), wait_for_connections(), wap_appl_init(), wap_push_ota_init(), wap_push_ppg_init(), wapbox_start(), wsp_push_client_init(), wsp_session_init(), wsp_unit_init(), wtp_initiator_init(), and wtp_resp_init().
#define MAIN_THREAD_ID 0 |
Definition at line 77 of file gwthread.h.
Referenced by gwthread_create_real(), httpd_shutdown(), sms_router(), smsboxc_run(), udp_receiver(), and wapboxc_run().
typedef void gwthread_func_t(void *arg) |
Definition at line 79 of file gwthread.h.
int gwthread_cancel | ( | long | thread | ) |
Definition at line 843 of file gwthread-pthread.c.
References debug(), gw_assert(), lock(), threadinfo::name, threadinfo::number, threadinfo::self, THREAD, and unlock().
Referenced by main().
long gwthread_create_real | ( | gwthread_func_t * | func, |
const char * | funcname, | ||
void * | arg | ||
) |
Definition at line 508 of file gwthread-pthread.c.
References new_thread_args::arg, block_user_signals(), new_thread_args::func, gwthread_self(), MAIN_THREAD_ID, name, restore_user_signals(), and spawn_thread().
int gwthread_dumpsigmask | ( | void | ) |
void gwthread_init | ( | void | ) |
Definition at line 267 of file gwthread-pthread.c.
References active_threads, fill_threadinfo(), mainthread, panic, threadtable, threadtable_lock, THREADTABLE_SIZE, and tsd_key.
Referenced by gwlib_init().
void gwthread_join | ( | long | thread | ) |
Definition at line 541 of file gwthread-pthread.c.
References gw_assert(), gwlist_append(), gwlist_create, threadinfo::joiners, lock(), threadinfo::number, THREAD, threadtable_lock, unlock(), and warning().
Referenced by cimd2_shutdown_cb(), emi2_sender(), fdset_destroy(), gw_timerset_destroy(), gw_timerset_elapsed_destroy(), gwthread_join_all(), heartbeat_stop(), httpd_emu_destroy(), httpsmsc_receiver(), httpsmsc_sender(), io_thread(), main(), oisd_shutdown_cb(), receive_smpp_thread(), run_smppbox(), run_smsbox(), run_sqlbox(), run_wapbox(), shutdown_cb(), smpp_emu(), smpp_emu_reader(), smsboxc_run(), smsc_cimd2_create(), smsc_emi2_create(), smsc_emu_destroy(), smsc_oisd_create(), smsc_smpp_create(), soap_server_stop(), soap_shutdown_cb(), store_file_shutdown(), timers_shutdown(), udp_sender(), and wrapper_sender().
void gwthread_join_all | ( | void | ) |
Definition at line 585 of file gwthread-pthread.c.
References gwthread_join(), gwthread_self(), THREAD, and THREADTABLE_SIZE.
Referenced by main().
void gwthread_join_every | ( | gwthread_func_t * | func | ) |
Definition at line 607 of file gwthread-pthread.c.
References debug(), threadinfo::func, gwlist_append(), gwlist_create, threadinfo::joiners, lock(), threadinfo::name, threadinfo::number, THREAD, threadtable_lock, THREADTABLE_SIZE, unlock(), and warning().
Referenced by client_shutdown(), http_close_all_ports(), httpadmin_stop(), main(), main_for_producer_and_consumer(), radius_acct_shutdown(), server_shutdown(), wap_appl_shutdown(), wap_push_ota_shutdown(), wap_push_ppg_shutdown(), wsp_push_client_shutdown(), wsp_session_shutdown(), wsp_unit_shutdown(), wtp_initiator_shutdown(), and wtp_resp_shutdown().
int gwthread_poll | ( | struct pollfd * | fds, |
long | numfds, | ||
double | timeout | ||
) |
Definition at line 740 of file gwthread-pthread.c.
References error(), pollfd::events, pollfd::fd, flushpipe(), getthreadinfo(), poll, POLL_NOTIMEOUT, POLLIN, pollfd::revents, and threadinfo::wakefd_recv.
Referenced by poller(), and server_thread().
int gwthread_pollfd | ( | int | fd, |
int | events, | ||
double | timeout | ||
) |
Definition at line 706 of file gwthread-pthread.c.
References error(), pollfd::events, pollfd::fd, flushpipe(), getthreadinfo(), poll, POLL_NOTIMEOUT, POLLIN, pollfd::revents, and threadinfo::wakefd_recv.
Referenced by accept_thread(), cgw_listener(), cgw_wait_command(), conn_flush(), conn_wait(), emi2_listener(), fake_listener(), gw_accept(), and wait_for_connections().
long gwthread_self | ( | void | ) |
Definition at line 650 of file gwthread-pthread.c.
void gwthread_self_ids | ( | long * | tid, |
long * | pid | ||
) |
Definition at line 671 of file gwthread-pthread.c.
References threadinfo::number, threadinfo::pid, and tsd_key.
Referenced by format().
long gwthread_self_pid | ( | void | ) |
Definition at line 661 of file gwthread-pthread.c.
References threadinfo::pid, and tsd_key.
int gwthread_shouldhandlesignal | ( | int | signal | ) |
Definition at line 867 of file gwthread-pthread.c.
Referenced by signal_handler().
void gwthread_shutdown | ( | void | ) |
Definition at line 296 of file gwthread-pthread.c.
References debug(), gw_assert(), lock(), name, number, running, threadtable, threadtable_lock, THREADTABLE_SIZE, unlock(), and warning().
Referenced by gwlib_shutdown().
void gwthread_sleep | ( | double | seconds | ) |
Definition at line 780 of file gwthread-pthread.c.
References pollfd::events, pollfd::fd, flushpipe(), getthreadinfo(), poll, POLL_NOTIMEOUT, POLLIN, threadinfo::wakefd_recv, and warning().
Referenced by at2_detect_modem_type(), at2_device_thread(), at2_init_device(), at2_login_device(), at2_send_one_message(), at2_write(), at2_write_ctrlz(), at2_write_line(), bb_smscconn_receive_internal(), cgw_open_send_connection(), client_thread(), emi2_do_send(), emi2_wait(), heartbeat_thread(), httpd_check_authorization(), httpsmsc_send_cb(), httpsmsc_sender(), io_thread(), main(), main_connection_loop(), open_send_connection(), parachute_start(), poller(), port_remove(), push_thread(), reconnect(), restart_box(), send_message(), send_messages(), send_smpp_thread(), server_thread(), smasi_thread(), smpp_to_bearerbox(), sms_router(), sms_to_smsboxes(), smsbox_thread(), smsboxc_run(), smsc2_graceful_restart(), soap_listener(), soap_server(), sql_list(), sql_single(), store_dumper(), thread1(), thread2(), wait_for_connections(), wapboxc_run(), watch_timers(), and wrapper_receiver().
void gwthread_sleep_micro | ( | double | dseconds | ) |
Definition at line 808 of file gwthread-pthread.c.
References flushpipe(), getthreadinfo(), threadinfo::wakefd_recv, and warning().
void gwthread_wakeup | ( | long | thread | ) |
Definition at line 684 of file gwthread-pthread.c.
References gw_assert(), lock(), threadinfo::number, THREAD, unlock(), and threadinfo::wakefd_send.
Referenced by add_msg_cb(), at2_add_msg_cb(), at2_shutdown_cb(), at2_start_cb(), bb_smscconn_connected(), boxc_receiver(), cgw_add_msg_cb(), cgw_listener(), cgw_shutdown_cb(), cgw_start_cb(), cimd2_add_msg_cb(), cimd2_shutdown_cb(), cimd2_start_cb(), client_destroy(), emi2_idleprocessing(), emi2_listener(), emi2_sender(), gw_timer_elapsed_start(), gw_timer_elapsed_start_cb(), gw_timer_start(), gw_timerset_destroy(), gw_timerset_elapsed_destroy(), gwthread_wakeup_all(), gwtimer_start(), heartbeat_stop(), http_close_all_ports(), http_close_port(), http_open_port_if(), httpd_shutdown(), httpsmsc_receiver(), httpsmsc_sender(), httpsmsc_shutdown(), io_thread(), main(), oisd_add_msg_cb(), oisd_shutdown_cb(), oisd_start_cb(), run_smsbox(), send_msg_cb(), server_shutdown(), shutdown_cb(), smpp_emu(), sms_router(), smsboxc_run(), smsc2_graceful_restart(), smsc2_restart_smsc(), smsc2_resume(), smsc2_shutdown(), smsc_cimd2_create(), smsc_emi2_create(), smsc_emu_destroy(), smsc_oisd_create(), smsc_smpp_create(), soap_add_msg_cb(), soap_server_stop(), soap_shutdown_cb(), start_cb(), store_file_shutdown(), submit_action(), submit_action_nosync(), timers_shutdown(), udp_receiver(), wapboxc_run(), wrapper_sender(), and wrapper_shutdown().
void gwthread_wakeup_all | ( | void | ) |
Definition at line 596 of file gwthread-pthread.c.
References gwthread_self(), gwthread_wakeup(), THREAD, and THREADTABLE_SIZE.
Referenced by httpd_restart(), main(), and quit().