Base class for the threads in the Event System. More...
#include <I_Thread.h>
Inherited by EThread.
Base class for the threads in the Event System.
Thread is the base class for all the thread classes in the Event System. Objects of the Thread class represent spawned or running threads and provide minimal information for its derived classes. Thread objects have a reference to a ProxyMutex, that is used for atomic operations internally, and an ink_thread member that is used to identify the thread in the system.
You should not create an object of the Thread class, they are typically instantiated after some thread startup mechanism exposed by a processor, but even then you would probably deal with processor functions and not the Thread object itself.
Definition at line 95 of file I_Thread.h.
Thread::Thread | ( | ) |
Definition at line 45 of file Thread.cc.
References mutex, mutex_ptr, MUTEX_TAKE_LOCK, new_ProxyMutex(), and ProxyMutex::nthread_holding.
TS_INLINE Thread::~Thread | ( | ) | [virtual] |
Definition at line 41 of file P_Thread.h.
virtual void Thread::execute | ( | ) | [inline, virtual] |
Reimplemented in EThread.
Definition at line 155 of file I_Thread.h.
Referenced by main(), and spawn_thread_internal().
TS_INLINE void Thread::set_specific | ( | ) |
Definition at line 46 of file P_Thread.h.
References ink_thread_setspecific(), and thread_data_key.
Referenced by ink_thread_trampoline(), main(), spawn_thread_internal(), and TSThreadInit().
ink_thread Thread::start | ( | const char * | name, | |
size_t | stacksize = DEFAULT_STACKSIZE , |
|||
ThreadFunction | f = NULL , |
|||
void * | a = NULL | |||
) |
Definition at line 94 of file Thread.cc.
References thread_data_internal::a, ats_malloc(), thread_data_internal::f, ink_strlcpy(), ink_thread_create(), MAX_THREAD_NAME_LENGTH, thread_data_internal::me, thread_data_internal::name, spawn_thread_internal(), and tid.
Referenced by EventProcessor::spawn_event_threads(), EventProcessor::spawn_thread(), and EventProcessor::start().
Definition at line 137 of file I_Thread.h.
ink_hrtime Thread::cur_time = 0 [static] |
Definition at line 125 of file I_Thread.h.
Referenced by EThread::execute(), ink_get_based_hrtime(), ink_get_hrtime(), EThread::process_event(), and EventProcessor::start().
Definition at line 141 of file I_Thread.h.
Definition at line 130 of file I_Thread.h.
Referenced by EThread::free_event(), EThread::schedule_at(), EThread::schedule_at_local(), EThread::schedule_every(), EThread::schedule_every_local(), EThread::schedule_imm(), EThread::schedule_imm_local(), EThread::schedule_imm_signal(), EThread::schedule_in(), EThread::schedule_in_local(), and EThread::schedule_spawn().
Definition at line 135 of file I_Thread.h.
Definition at line 133 of file I_Thread.h.
Definition at line 134 of file I_Thread.h.
Definition at line 143 of file I_Thread.h.
Definition at line 144 of file I_Thread.h.
ProxyAllocator Thread::ioBufAllocator[DEFAULT_BUFFER_SIZES] |
Definition at line 145 of file I_Thread.h.
Definition at line 142 of file I_Thread.h.
Thread lock to ensure atomic operations.
The thread lock available to derived classes to ensure atomic operations and protect critical regions. Do not modify this member directly.
Definition at line 118 of file I_Thread.h.
Referenced by UnixNetProcessor::accept_internal(), Log::access(), cache(), Cache_dir(), cache_lookup_ClusterFunction(), cache_op_ClusterFunction(), cache_op_result_ClusterFunction(), CacheProcessor::cacheInitialized(), ChannelToCacheWriteVC(), ClusterMachine::ClusterMachine(), configuration_add_machine(), configuration_remove_machine(), ClusterProcessor::connect_local(), Log::flush_thread_main(), free_ClusterMachine(), HostDBProcessor::getbyname_imm(), HostDBProcessor::getbyname_re(), HostDBProcessor::getSRVbyname_imm(), ICPConfiguration::icp_config_change_callback(), ICPProcessor::ICPQuery(), NetAccept::init_accept(), initialize_thread_for_net(), initialize_thread_for_udp_net(), ClusterVConnectionCache::insert(), ClusterProcessor::internal_invoke_remote(), UnixNetVConnection::load_buffer_and_write(), SSLNetVConnection::load_buffer_and_write(), LogObjectManager::log(), ClusterVConnectionCache::lookup(), UnixNetVConnection::mainEvent(), MultiCacheSync::mcEvent(), DNSProcessor::open(), ClusterProcessor::open_local(), post_setchan_pin_ClusterFunction(), post_setchan_priority_ClusterFunction(), post_setchan_send_ClusterFunction(), LogFile::preproc_and_try_delete(), read_from_net(), ClusterControl::real_alloc_data(), EventProcessor::schedule(), EThread::schedule(), set_channel_data_ClusterFunction(), EventProcessor::spawn_thread(), EventProcessor::start(), Thread(), Log::va_error(), LogFile::write_ascii_logbuffer3(), write_to_net(), and write_to_net_io().
Definition at line 127 of file I_Thread.h.
Referenced by Thread().
Definition at line 131 of file I_Thread.h.
Definition at line 138 of file I_Thread.h.
Definition at line 139 of file I_Thread.h.
Definition at line 140 of file I_Thread.h.
Definition at line 132 of file I_Thread.h.
Definition at line 136 of file I_Thread.h.
inkcoreapi ink_thread_key Thread::thread_data_key = init_thread_key() [static] |
Definition at line 126 of file I_Thread.h.
Referenced by init_thread_key(), set_specific(), EventProcessor::start(), and this_thread().
System-wide thread identifier.
The thread identifier is represented by the platform independent type ink_thread and it is the system-wide value assigned to each thread. It is exposed as a convenience for processors and you should not modify it directly.
Definition at line 110 of file I_Thread.h.
Referenced by CoreUtils::process_EThread(), and start().