diff options
author | Christopher Haster <chaster@utexas.edu> | 2020-12-04 08:47:32 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2020-12-04 08:47:32 +0300 |
commit | ce425a56c322cea7152d01f1781f93d6581ad420 (patch) | |
tree | fc7ced032666c0aaace7a862b11e864dfe2d5df3 /lfs.h | |
parent | b9fa33f9bc001fba6137eb1fe3b6e36d36985678 (diff) | |
parent | a99a93fb2704b0a3ea6904b5676e9e13c66556ce (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.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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; |