Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Modernize simcall_execution_test().
[simgrid.git] / src / kernel / activity / ActivityImpl.cpp
index 2406311..a4060f6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -37,6 +37,15 @@ double ActivityImpl::get_remaining() const
   return surf_action_ ? surf_action_->get_remains() : 0;
 }
 
+bool ActivityImpl::test()
+{
+  if (state_ != State::WAITING && state_ != State::RUNNING) {
+    finish();
+    return true;
+  }
+  return false;
+}
+
 void ActivityImpl::suspend()
 {
   if (surf_action_ == nullptr)