This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSP432E411Y-BGAEVM:标准:互斥

Guru**** 655270 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1061866/msp432e411y-bgaevm-std-mutex

器件型号:MSP432E411Y-BGAEVM

您好!
我将从 Linux 平台移植 C++应用程序、以便在 TI RTOS 下运行。 如果可能、我想使用 std::mutex。
添加:-

#include

编译正常、但一旦我尝试并声明 a、就会立即编译

标准::mutex myMutex;

它只是说命名空间 std 不包括 mutex。

我已跟踪中的头文件

C:\ti\ccs1040\ccs\tools\compiler\ti-cgt-arm_20.2.5.LTS \include\libcxx

请注意、第一个部分、包括命名空间 std、被注释掉、但后面的位包括_mutes_base、这似乎是通过宏 _LIBCPP_BEGIN_namespace _STD 定义 std。

理想情况下、为了最大程度地减小变化、我想使用

 标准::lock_guard LK (myMutex);

但是、只有互斥量起作用将是一个良好的开端。

有任何提示吗?

谢谢

Jim  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    有人迎接挑战?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    找到 std::mutex 、它指出 TI 编译器不支持需要 与底层 操作系统或 RTOS 集成的 C++11并发功能。  

    [常见问题解答]编译器:支持哪个 C++标准? 包含:

    [引用]一般而言,支持大多数标准,但需要与操作系统协调的功能除外。[/引用]

    因此、可以理解为什么尝试使用 std::mutex 会导致错误、但不确定需要进行哪些修改才能添加 std:mutex 支持。

    [引用 userid="500257" URL"~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1061866/msp432e411y-bgaevm-std-mutex "]我要将 C++应用程序从 Linux 平台移植到 TI RTOS 下运行。

    也许可以创建一个 std::mutex 的包装程序、此包装程序使用底层 TI-RTOS mutex 支持。