Better fix for bug #50838 (mem.c needs SYS_ARCH_PROTECTION around MEM_STATS): only lock where necessary

This commit is contained in:
goldsimon
2017-04-24 12:23:05 +02:00
parent bd483fa229
commit 16a71473c1
2 changed files with 24 additions and 17 deletions

View File

@@ -447,6 +447,15 @@ void sys_arch_unprotect(sys_prot_t pval);
} while(0)
#endif /* SYS_ARCH_SET */
#ifndef SYS_ARCH_LOCKED
#define SYS_ARCH_LOCKED(code) do { \
SYS_ARCH_DECL_PROTECT(old_level); \
SYS_ARCH_PROTECT(old_level); \
code; \
SYS_ARCH_UNPROTECT(old_level); \
} while(0)
#endif /* SYS_ARCH_LOCKED */
#ifdef __cplusplus
}