Skip to content

Commit 486de95

Browse files
committed
Prevent the preemption timer to run when termination is requested
* The call to cancel() might not work if it was about to expire.
1 parent b4ec26c commit 486de95

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vm/boostenv/main/boostvm.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ void BoostVM::run() {
164164
}
165165

166166
void BoostVM::onPreemptionTimerExpire(const boost::system::error_code& error) {
167-
if (error != boost::asio::error::operation_aborted) {
167+
if (error != boost::asio::error::operation_aborted &&
168+
!_terminationRequested) {
168169
// Preemption
169170
vm->setReferenceTime(env.getReferenceTime());
170171
vm->requestPreempt();

0 commit comments

Comments
 (0)