Skip to content

Commit 68b77ac

Browse files
authored
Update main.cpp
Signed-off-by: quic-khrahul <131336334+quic-khrahul@users.noreply.github.com>
1 parent 089964d commit 68b77ac

File tree

1 file changed

+5
-6
lines changed
  • RB5/linux_kernel_5_x/AI-ML-apps/AI_Age_Gender_Emotion_Solution/src

1 file changed

+5
-6
lines changed

RB5/linux_kernel_5_x/AI-ML-apps/AI_Age_Gender_Emotion_Solution/src/main.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,18 @@ void InferenceThread(void *sol_conf,int model_id, int size)
110110
uint32_t frames = 0;
111111
do
112112
{
113+
unique_lock<mutex> lock(mu);
114+
cond.wait(lock, [&](){
115+
return model_id == current_model;
116+
}
117+
);
113118
if(current_model == face_detect)
114119
{
115120
ret = gDecodeQueue->Dequeue(item, 300);
116121
}
117122
if (ret == 0)
118123
{
119124
frames += 1;
120-
121-
unique_lock<mutex> lock(mu);
122-
cond.wait(lock, [&](){
123-
return model_id == current_model;
124-
}
125-
);
126125
auto start1 = chrono::steady_clock::now();
127126
shInference->Inference(item);
128127
auto end1 = chrono::steady_clock::now();

0 commit comments

Comments
 (0)