reduce the scope of mutex (#1561)

This commit is contained in:
Dean Lee
2020-05-27 00:57:14 +08:00
committed by GitHub
parent a63814866b
commit d5858955ee
+2 -2
View File
@@ -44,8 +44,7 @@ void* live_thread(void *arg) {
while (!do_exit) {
if (sm.update(10) > 0){
pthread_mutex_lock(&transform_lock);
auto extrinsic_matrix = sm["liveCalibration"].getLiveCalibration().getExtrinsicMatrix();
Eigen::Matrix<float, 3, 4> extrinsic_matrix_eigen;
for (int i = 0; i < 4*3; i++){
@@ -60,6 +59,7 @@ void* live_thread(void *arg) {
auto warp_matrix = camera_frame_from_ground * ground_from_medmodel_frame;
pthread_mutex_lock(&transform_lock);
for (int i=0; i<3*3; i++) {
cur_transform.v[i] = warp_matrix(i / 3, i % 3);
}