From d3a9985f101aa45972eafe943e68eef70efc5e3d Mon Sep 17 00:00:00 2001 From: Siu Chi Chan Date: Sat, 2 Jun 2018 17:55:37 -0400 Subject: [PATCH] callback handler: don't need to wait for the thread to become ready --- src/hip_stream.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/hip_stream.cpp b/src/hip_stream.cpp index d9c227b6ac..4170e33d63 100644 --- a/src/hip_stream.cpp +++ b/src/hip_stream.cpp @@ -201,14 +201,5 @@ hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback ihipStreamCallback_t* cb = new ihipStreamCallback_t(stream, callback, userData); std::thread(ihipStreamCallbackHandler, cb).detach(); - // Wait for thread to be ready - cb->_mtx.lock(); - while (cb->_ready != true) { - cb->_mtx.unlock(); - std::this_thread::sleep_for(std::chrono::milliseconds(10)); - cb->_mtx.lock(); - } - cb->_mtx.unlock(); - return ihipLogStatus(e); }