A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modernize simcall_execution_test().
[simgrid.git]
/
src
/
kernel
/
activity
/
ActivityImpl.cpp
diff --git
a/src/kernel/activity/ActivityImpl.cpp
b/src/kernel/activity/ActivityImpl.cpp
index
c5f3524
..
a4060f6
100644
(file)
--- a/
src/kernel/activity/ActivityImpl.cpp
+++ b/
src/kernel/activity/ActivityImpl.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2007-20
19
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-20
20
. 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. */
/* 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. */
@@
-21,7
+21,7
@@
ActivityImpl::~ActivityImpl()
void ActivityImpl::register_simcall(smx_simcall_t simcall)
{
simcalls_.push_back(simcall);
void ActivityImpl::register_simcall(smx_simcall_t simcall)
{
simcalls_.push_back(simcall);
- simcall->issuer->waiting_synchro = this;
+ simcall->issuer
_
->waiting_synchro = this;
}
void ActivityImpl::clean_action()
}
void ActivityImpl::clean_action()
@@
-37,6
+37,15
@@
double ActivityImpl::get_remaining() const
return surf_action_ ? surf_action_->get_remains() : 0;
}
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)
void ActivityImpl::suspend()
{
if (surf_action_ == nullptr)
@@
-60,7
+69,7
@@
void ActivityImpl::cancel()
XBT_VERB("Activity %p is canceled", this);
if (surf_action_ != nullptr)
surf_action_->cancel();
XBT_VERB("Activity %p is canceled", this);
if (surf_action_ != nullptr)
surf_action_->cancel();
- state_ = S
IMIX_
CANCELED;
+ state_ = S
tate::
CANCELED;
}
// boost::intrusive_ptr<Activity> support:
}
// boost::intrusive_ptr<Activity> support: