[mlir:async] Fix data races in AsyncRuntime
authorEugene Zhulenev <ezhulenev@google.com>
Wed, 20 Jan 2021 13:17:12 +0000 (05:17 -0800)
committerEugene Zhulenev <ezhulenev@google.com>
Wed, 20 Jan 2021 21:23:39 +0000 (13:23 -0800)
commita2223b09b10a4cc87b5e9c4a36ab9401c46610f6
tree7c70fe2ccb900f651ad7e8be3ec9c0e88ac7214f
parent36b05d2e9f553eab37c8646a4db3bdadb4279d38
[mlir:async] Fix data races in AsyncRuntime

Resumed coroutine potentially can deallocate the token/value/group and destroy the mutex before the std::unique_ptr destructor.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D95037
mlir/lib/ExecutionEngine/AsyncRuntime.cpp