MyTaskClass Class Reference
Collaboration diagram for MyTaskClass:

Public Member Functions

 MyTaskClass (int32 i, std::vector< int32 > *vec)
 
void operator() ()
 
 ~MyTaskClass ()
 

Private Attributes

bool done_
 
int32 i_
 
std::vector< int32 > * vec_
 

Detailed Description

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

Constructor & Destructor Documentation

◆ MyTaskClass()

MyTaskClass ( int32  i,
std::vector< int32 > *  vec 
)
inline

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

85  :
86  done_(false), i_(i), vec_(vec) { }
std::vector< int32 > * vec_

◆ ~MyTaskClass()

~MyTaskClass ( )
inline

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

References KALDI_ASSERT.

93  {
95  vec_->push_back(i_);
96  }
std::vector< int32 > * vec_
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:185

Member Function Documentation

◆ operator()()

void operator() ( )
inline

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

References rnnlm::i, and kaldi::Rand().

88  {
89  int32 spin = 1000000 * Rand() % 100;
90  for (int32 i = 0; i < spin; i++);
91  done_ = true;
92  }
kaldi::int32 int32
int Rand(struct RandomState *state)
Definition: kaldi-math.cc:45

Member Data Documentation

◆ done_

bool done_
private

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

◆ i_

int32 i_
private

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

◆ vec_

std::vector<int32>* vec_
private

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


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