mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-26 01:00:36 +08:00
logger: move _writer.lock() call after write_changed_parameters()
write_changed_parameters() also takes the lock and thus would deadlock otherwise.
This commit is contained in:
1 parent
3de7fbb0a9
commit
4ce658ab99
1 file changed
+3
-2
@@ -476,8 +476,6 @@ void Logger::run()
|
||||
}
|
||||
|
||||
if (_enabled) {
|
||||
/* wait for lock on log buffer */
|
||||
_writer.lock();
|
||||
|
||||
bool data_written = false;
|
||||
|
||||
@@ -492,6 +490,9 @@ void Logger::run()
|
||||
// Write data messages for normal subscriptions
|
||||
int msg_id = 0;
|
||||
|
||||
/* wait for lock on log buffer */
|
||||
_writer.lock();
|
||||
|
||||
for (LoggerSubscription &sub : _subscriptions) {
|
||||
/* each message consists of a header followed by an orb data object
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user