Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lfs.h
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2020-12-04 08:47:32 +0300
committerChristopher Haster <chaster@utexas.edu>2020-12-04 08:47:32 +0300
commitce425a56c322cea7152d01f1781f93d6581ad420 (patch)
treefc7ced032666c0aaace7a862b11e864dfe2d5df3 /lfs.h
parentb9fa33f9bc001fba6137eb1fe3b6e36d36985678 (diff)
parenta99a93fb2704b0a3ea6904b5676e9e13c66556ce (diff)
Merge pull request #470 from renesas/SWFLEX-1517-littlefs-thread-safe-option
Add thread safe wrappers
Diffstat (limited to 'lfs.h')
-rw-r--r--lfs.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lfs.h b/lfs.h
index 67a3f32..a752f8c 100644
--- a/lfs.h
+++ b/lfs.h
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <stdbool.h>
+#include "lfs_util.h"
#ifdef __cplusplus
extern "C"
@@ -180,6 +181,16 @@ struct lfs_config {
// are propogated to the user.
int (*sync)(const struct lfs_config *c);
+#ifdef LFS_THREADSAFE
+ // Lock the underlying block device. Negative error codes
+ // are propogated to the user.
+ int (*lock)(const struct lfs_config *c);
+
+ // Unlock the underlying block device. Negative error codes
+ // are propogated to the user.
+ int (*unlock)(const struct lfs_config *c);
+#endif
+
// Minimum size of a block read. All read operations will be a
// multiple of this value.
lfs_size_t read_size;