aamir
aamir

Reputation: 151

Is the concurrency::task<_ty> assignment operator thread-safe?

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?

Upvotes: 2

Views: 90

Answers (0)

Related Questions