MyThreadClass Class Reference
Inheritance diagram for MyThreadClass:
Collaboration diagram for MyThreadClass:

Public Member Functions

 MyThreadClass (int32 max_to_count, int32 *i)
 
 MyThreadClass (const MyThreadClass &other)
 
void operator() ()
 
 ~MyThreadClass ()
 
- Public Member Functions inherited from MultiThreadable
virtual ~MultiThreadable ()
 

Private Member Functions

 MyThreadClass ()
 

Private Attributes

int32 max_to_count_
 
int32iptr_
 
int32 private_counter_
 

Additional Inherited Members

- Public Attributes inherited from MultiThreadable
int32 thread_id_
 
int32 num_threads_
 

Detailed Description

Definition at line 29 of file kaldi-thread-test.cc.

Constructor & Destructor Documentation

◆ MyThreadClass() [1/3]

MyThreadClass ( int32  max_to_count,
int32 i 
)
inline

Definition at line 31 of file kaldi-thread-test.cc.

◆ MyThreadClass() [2/3]

MyThreadClass ( const MyThreadClass other)
inline

◆ ~MyThreadClass()

~MyThreadClass ( )
inline

◆ MyThreadClass() [3/3]

MyThreadClass ( )
inlineprivate

Definition at line 55 of file kaldi-thread-test.cc.

55 { } // Disallow empty constructor.

Member Function Documentation

◆ operator()()

void operator() ( )
inlinevirtual

Implements MultiThreadable.

Definition at line 42 of file kaldi-thread-test.cc.

References rnnlm::j, MyThreadClass::max_to_count_, MultiThreadable::num_threads_, MyThreadClass::private_counter_, and MultiThreadable::thread_id_.

42  {
43  int32 block_size = (max_to_count_+ (num_threads_-1) ) / num_threads_;
44  int32 start = block_size * thread_id_,
45  end = std::min(max_to_count_, start + block_size);
46  for (int32 j = start; j < end; j++)
48  }
kaldi::int32 int32

Member Data Documentation

◆ iptr_

int32* iptr_
private

Definition at line 57 of file kaldi-thread-test.cc.

Referenced by MyThreadClass::~MyThreadClass().

◆ max_to_count_

int32 max_to_count_
private

Definition at line 56 of file kaldi-thread-test.cc.

Referenced by MyThreadClass::operator()().

◆ private_counter_

int32 private_counter_
private

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