source: src/libcfa/concurrency/threads@ 9129a84

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since 9129a84 was 9129a84, checked in by Thierry Delisle <tdelisle@…>, 9 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
21struct coroutine {
22 coroutine* last;
23 const char* name;
24 bool notHalted;
25};
26
27void ?{}(coroutine* this);
28
29trait coroutine_t(dtype T) {
30 coroutine* this_coroutine(T* this);
31};
32
33void suspend(void);
34
35forall(dtype T | coroutine_t(T))
36void resume(T* cor);
37
38#endif //__THREADS_H__
Note: See TracBrowser for help on using the repository browser.