Fix the case of using STL without pthreads but with mutexes (#1433)

* Print test names at test time (#1343)

* Fix operator| conflict with std::ranges (#1395)

* Fix the case of using STL without pthreads but with mutexes

On non-POSIX targets in STL mode, std::mutex is included from
mutex.h but will probably miss pthreads. Instead, other
implementations might be detected and used in mutex.h.

Therefore, adding ETL_NO_STD_MUTEX as a profile option for ETL.

Further, removing unnecessary includes from queue headers.

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
This commit is contained in:
Roland Reichwein 2026-05-09 10:29:18 +02:00 committed by GitHub
parent f6f145c5e5
commit 57d3867694
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 11 additions and 4 deletions

View File

@ -40,7 +40,7 @@ SOFTWARE.
#elif defined(ETL_TARGET_OS_THREADX)
#include "mutex/mutex_threadx.h"
#define ETL_HAS_MUTEX 1
#elif ETL_USING_STL && ETL_USING_CPP11
#elif ETL_USING_STL && ETL_USING_CPP11 && ETL_USING_STD_MUTEX
#include "mutex/mutex_std.h"
#define ETL_HAS_MUTEX 1
#elif defined(ETL_COMPILER_ARM5) || defined(ETL_COMPILER_ARM6) || defined(ETL_COMPILER_ARM7) || defined(ETL_COMPILER_ARM8)

View File

@ -102,6 +102,16 @@ SOFTWARE.
#define ETL_NOT_USING_STL 0
#endif
//*************************************
// Helper macros for ETL_NO_STD_MUTEX.
#if defined(ETL_NO_STD_MUTEX)
#define ETL_USING_STD_MUTEX 0
#define ETL_NOT_USING_STD_MUTEX 1
#else
#define ETL_USING_STD_MUTEX 1
#define ETL_NOT_USING_STD_MUTEX 0
#endif
//*************************************
// Helper macros for ETL_STLPORT.
#if defined(ETL_STLPORT)

View File

@ -35,7 +35,6 @@ SOFTWARE.
#include "integral_limits.h"
#include "memory.h"
#include "memory_model.h"
#include "mutex.h"
#include "parameter_type.h"
#include "placement_new.h"
#include "utility.h"

View File

@ -35,7 +35,6 @@ SOFTWARE.
#include "alignment.h"
#include "integral_limits.h"
#include "memory_model.h"
#include "mutex.h"
#include "parameter_type.h"
#include "placement_new.h"
#include "utility.h"

View File

@ -36,7 +36,6 @@ SOFTWARE.
#include "integral_limits.h"
#include "memory.h"
#include "memory_model.h"
#include "mutex.h"
#include "parameter_type.h"
#include "placement_new.h"
#include "utility.h"