Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions profile/plugin/aie_status/aie_status_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,21 +505,26 @@ namespace xdp {
***************************************************************************/
void AIEStatusPlugin::endPollforDevice(void* handle)
{
// Last chance at writing status reports
for (auto w : writers) {
mtxWriterThread.lock();
w->write(false, handle);
mtxWriterThread.unlock();
}

// When ending polling for a device, if we are on edge we must instead
// shut down all of the threads and not just a single one in order
// to avoid race conditions between the zynq driver destructor and our own.
//
// Currently, Edge is the only supported type of platform so we can
// safely end all threads here, but this must be revisited if we extend
// AIE status functionality to other types of platforms.
//
// Stop background threads before the final write. pollDeadlock reads AIE
// registers while write() queries sysfs via get_info; running both during
// teardown can hang the driver.
endPoll();

// Last chance at writing status reports
for (auto w : writers) {
//mtxWriterThread.lock();
std::lock_guard<std::mutex> lock(mtxWriterThread);
w->write(false, handle);
//mtxWriterThread.unlock();
}
}

/****************************************************************************
Expand Down
Loading