Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mobile_robotics
ADC
external
libuvc_ros
Commits
e1886d04
Commit
e1886d04
authored
Dec 13, 2016
by
Jason Mercer
Committed by
Ken Tossell
Jul 06, 2019
Browse files
Fixed locks so they stay in scope until end of method.
parent
c8d1bf5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
libuvc_camera/src/camera_driver.cpp
View file @
e1886d04
...
...
@@ -84,7 +84,7 @@ bool CameraDriver::Start() {
}
void
CameraDriver
::
Stop
()
{
boost
::
recursive_mutex
::
scoped_lock
(
mutex_
);
boost
::
recursive_mutex
::
scoped_lock
lock
(
mutex_
);
assert
(
state_
!=
kInitial
);
...
...
@@ -100,7 +100,7 @@ void CameraDriver::Stop() {
}
void
CameraDriver
::
ReconfigureCallback
(
UVCCameraConfig
&
new_config
,
uint32_t
level
)
{
boost
::
recursive_mutex
::
scoped_lock
(
mutex_
);
boost
::
recursive_mutex
::
scoped_lock
lock
(
mutex_
);
if
((
level
&
kReconfigureClose
)
==
kReconfigureClose
)
{
if
(
state_
==
kRunning
)
...
...
@@ -167,7 +167,7 @@ void CameraDriver::ImageCallback(uvc_frame_t *frame) {
timestamp
=
ros
::
Time
::
now
();
}
boost
::
recursive_mutex
::
scoped_lock
(
mutex_
);
boost
::
recursive_mutex
::
scoped_lock
lock
(
mutex_
);
assert
(
state_
==
kRunning
);
assert
(
rgb_frame_
);
...
...
@@ -247,7 +247,7 @@ void CameraDriver::AutoControlsCallback(
int
selector
,
enum
uvc_status_attribute
status_attribute
,
void
*
data
,
size_t
data_len
)
{
boost
::
recursive_mutex
::
scoped_lock
(
mutex_
);
boost
::
recursive_mutex
::
scoped_lock
lock
(
mutex_
);
printf
(
"Controls callback. class: %d, event: %d, selector: %d, attr: %d, data_len: %zu
\n
"
,
status_class
,
event
,
selector
,
status_attribute
,
data_len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment