PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223
  1. #ifndef RUNNABLE_H
  2. #define RUNNABLE_H
  3. /*
  4. * File Purpose
  5. * This is an abstract class that is reusable to allow for easy defintion of a runnable function for std::thread
  6. */
  7. class Runnable{
  8. private:
  9. protected:
  10. virtual void runTarget(void *arg) = 0;
  11. public:
  12. virtual ~Runnable(){}
  13. static void runThread(void *arg)
  14. {
  15. Runnable *_runnable = static_cast<Runnable*> (arg);
  16. _runnable->runTarget(arg);
  17. }
  18. };
  19. #endif // RUNNABLE_H