mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 06:47:35 +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:
@@ -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