Public Member Functions | Data Fields | Static Public Attributes

Thread Class Reference

Base class for the threads in the Event System. More...

#include <I_Thread.h>

Inherited by EThread.

Collaboration diagram for Thread:
Collaboration graph
[legend]

Public Member Functions

void set_specific ()
 Thread ()
virtual ~Thread ()
ink_thread start (const char *name, size_t stacksize=DEFAULT_STACKSIZE, ThreadFunction f=NULL, void *a=NULL)
virtual void execute ()

Data Fields

ink_thread tid
 System-wide thread identifier.
ProxyMutexmutex
 Thread lock to ensure atomic operations.
Ptr< ProxyMutexmutex_ptr
ProxyAllocator eventAllocator
ProxyAllocator netVCAllocator
ProxyAllocator sslNetVCAllocator
ProxyAllocator httpClientSessionAllocator
ProxyAllocator httpServerSessionAllocator
ProxyAllocator hdrHeapAllocator
ProxyAllocator strHeapAllocator
ProxyAllocator cacheVConnectionAllocator
ProxyAllocator openDirEntryAllocator
ProxyAllocator ramCacheCLFUSEntryAllocator
ProxyAllocator ramCacheLRUEntryAllocator
ProxyAllocator evacuationBlockAllocator
ProxyAllocator ioDataAllocator
ProxyAllocator ioAllocator
ProxyAllocator ioBlockAllocator
ProxyAllocator ioBufAllocator [DEFAULT_BUFFER_SIZES]

Static Public Attributes

static ink_hrtime cur_time = 0
static inkcoreapi ink_thread_key thread_data_key = init_thread_key()

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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 (  ) 
ink_thread Thread::start ( const char *  name,
size_t  stacksize = DEFAULT_STACKSIZE,
ThreadFunction  f = NULL,
void *  a = NULL 
)

Field Documentation

Definition at line 137 of file I_Thread.h.

Definition at line 141 of file I_Thread.h.

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().


The documentation for this class was generated from the following files: