2
task<void> t = []
{
     //do something
};

void post(std::function<void()> tExecute)
{
     t = t.then(tExecute);
}

I am trying to create a strand using the above code, where multiple threads can call post to ensure sequential processing of some tasks(functions/lambdas). Is the assignment in post() thread safe?

aamir
  • 151
  • 6

0 Answers0