ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change
on this file since 9129a84 was
9129a84,
checked in by Thierry Delisle <tdelisle@…>, 8 years ago
|
Implemented suspend and resume for coroutines (CtxSw? does nothing)
|
-
Property mode set to
100644
|
File size:
769 bytes
|
Line | |
---|
1 | // |
---|
2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
3 | // |
---|
4 | // The contents of this file are covered under the licence agreement in the |
---|
5 | // file "LICENCE" distributed with Cforall. |
---|
6 | // |
---|
7 | // fstream -- |
---|
8 | // |
---|
9 | // Author : Peter A. Buhr |
---|
10 | // Created On : Wed May 27 17:56:53 2015 |
---|
11 | // Last Modified By : Peter A. Buhr |
---|
12 | // Last Modified On : Thu Apr 28 08:08:04 2016 |
---|
13 | // Update Count : 88 |
---|
14 | // |
---|
15 | |
---|
16 | #ifndef __THREADS_H__ |
---|
17 | #define __THREADS_H__ |
---|
18 | |
---|
19 | #include <stdbool.h> |
---|
20 | |
---|
21 | struct coroutine { |
---|
22 | coroutine* last; |
---|
23 | const char* name; |
---|
24 | bool notHalted; |
---|
25 | }; |
---|
26 | |
---|
27 | void ?{}(coroutine* this); |
---|
28 | |
---|
29 | trait coroutine_t(dtype T) { |
---|
30 | coroutine* this_coroutine(T* this); |
---|
31 | }; |
---|
32 | |
---|
33 | void suspend(void); |
---|
34 | |
---|
35 | forall(dtype T | coroutine_t(T)) |
---|
36 | void resume(T* cor); |
---|
37 | |
---|
38 | #endif //__THREADS_H__ |
---|
Note: See
TracBrowser
for help on using the repository browser.