c++ string 转 wstring,mutex 锁
#include <mutex>
mutex CS; //全局零界值 //任务测试 class MyTestTask:public WorkItem{ string name; public: //需方法实现 void run(){ CS.lock() ; std::wstring ss; //string to wstring ss.assign(name.begin(),name.end()); ss = L"任务" + ss; Form1->Memo1->Lines->Add(ss.data()); CS.unlock() ; } public: MyTestTask(const string& name) { this->name = name; } };
好不容易活着