From b72dcf6478a67714b600fa45ec4c792bcbbb123e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 6 Sep 2019 07:38:21 +1000 Subject: [PATCH] AP_Filesystem: use a recursive semaphore this is needed to cope with the mkdir("/APM") in sdcard_retry() --- libraries/AP_Filesystem/AP_Filesystem_FATFS.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Filesystem/AP_Filesystem_FATFS.cpp b/libraries/AP_Filesystem/AP_Filesystem_FATFS.cpp index c5bd41ef5b..4409848b5d 100644 --- a/libraries/AP_Filesystem/AP_Filesystem_FATFS.cpp +++ b/libraries/AP_Filesystem/AP_Filesystem_FATFS.cpp @@ -24,8 +24,9 @@ static bool remount_needed; #define FATFS_X (S_IXUSR | S_IXGRP | S_IXOTH) /*< FatFs Execute perms */ // use a semaphore to ensure that only one filesystem operation is -// happening at a time -static HAL_Semaphore sem; +// happening at a time. A recursive semaphore is used to cope with the +// mkdir() inside sdcard_retry() +static HAL_Semaphore_Recursive sem; typedef struct { FIL *fh;