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
Define (and use) a callback for RawImpl::finish.
[simgrid.git]
/
src
/
kernel
/
activity
/
SynchroRaw.hpp
diff --git
a/src/kernel/activity/SynchroRaw.hpp
b/src/kernel/activity/SynchroRaw.hpp
index
d416f90
..
b4ed393
100644
(file)
--- a/
src/kernel/activity/SynchroRaw.hpp
+++ b/
src/kernel/activity/SynchroRaw.hpp
@@
-1,30
+1,39
@@
-/* Copyright (c) 2007-20
17
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-20
21
. 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. */
-#ifndef SIM
IX
_SYNCHRO_RAW_HPP
-#define SIM
IX
_SYNCHRO_RAW_HPP
+#ifndef SIM
GRID_KERNEL_ACTIVITY
_SYNCHRO_RAW_HPP
+#define SIM
GRID_KERNEL_ACTIVITY
_SYNCHRO_RAW_HPP
#include "src/kernel/activity/ActivityImpl.hpp"
#include "surf/surf.hpp"
#include "src/kernel/activity/ActivityImpl.hpp"
#include "surf/surf.hpp"
+#include <functional>
namespace simgrid {
namespace kernel {
namespace activity {
/** Used to implement mutexes, semaphores and conditions */
namespace simgrid {
namespace kernel {
namespace activity {
/** Used to implement mutexes, semaphores and conditions */
-XBT_PUBLIC_CLASS RawImpl : public ActivityImpl
-{
+class XBT_PUBLIC RawImpl : public ActivityImpl_T<RawImpl> {
+ sg_host_t host_ = nullptr;
+ double timeout_ = -1;
+ std::function<void()> finish_callback_;
+
public:
public:
- ~RawImpl() override;
+ explicit RawImpl(const std::function<void()>& finish_callback) : finish_callback_(finish_callback) {}
+ RawImpl& set_host(s4u::Host* host);
+ RawImpl& set_timeout(double timeout) override;
+
+ RawImpl* start();
void suspend() override;
void resume() override;
void suspend() override;
void resume() override;
+ void cancel() override;
void post() override;
void post() override;
-
-
surf_action_t sleep = nullptr
;
- };
-
-}
}} // namespace simgrid::kernel::activity
+ void finish() override;
+
}
;
+} // namespace activity
+} // namespace kernel
+}
// namespace simgrid
#endif
#endif