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
ThreadContext: define yield(), and use yield()/start() whenever possible.
[simgrid.git]
/
src
/
kernel
/
context
/
ContextThread.hpp
diff --git
a/src/kernel/context/ContextThread.hpp
b/src/kernel/context/ContextThread.hpp
index
3449f88
..
62d8191
100644
(file)
--- a/
src/kernel/context/ContextThread.hpp
+++ b/
src/kernel/context/ContextThread.hpp
@@
-22,9
+22,7
@@
class ThreadContextFactory;
class ThreadContext : public AttachContext {
public:
friend ThreadContextFactory;
class ThreadContext : public AttachContext {
public:
friend ThreadContextFactory;
- ThreadContext(std::function<void()> code,
- void_pfn_smxprocess_t cleanup_func,
- smx_actor_t process, bool maestro =false);
+ ThreadContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process, bool maestro);
~ThreadContext() override;
void stop() override;
void suspend() override;
~ThreadContext() override;
void stop() override;
void suspend() override;
@@
-37,11
+35,13
@@
private:
xbt_os_sem_t begin_ = nullptr;
/** Semaphore used to schedule/unschedule */
xbt_os_sem_t end_ = nullptr;
xbt_os_sem_t begin_ = nullptr;
/** Semaphore used to schedule/unschedule */
xbt_os_sem_t end_ = nullptr;
+ bool is_maestro_;
static void* wrapper(void *param);
static void* maestro_wrapper(void *param);
public:
void start();
static void* wrapper(void *param);
static void* maestro_wrapper(void *param);
public:
void start();
+ void yield();
};
class ThreadContextFactory : public ContextFactory {
};
class ThreadContextFactory : public ContextFactory {