//
// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
//
// The contents of this file are covered under the licence agreement in the
// file "LICENCE" distributed with Cforall.
//
// fstream --
//
// Author           : Peter A. Buhr
// Created On       : Wed May 27 17:56:53 2015
// Last Modified By : Peter A. Buhr
// Last Modified On : Thu Apr 28 08:08:04 2016
// Update Count     : 88
//

#ifndef __THREADS_H__
#define __THREADS_H__

#include <stdbool.h>

struct coroutine {
      coroutine* last;
      const char* name;
      bool notHalted;
};

void ?{}(coroutine* this);

trait coroutine_t(dtype T) {
      coroutine* this_coroutine(T* this);
};

void suspend(void);

forall(dtype T | coroutine_t(T))
void resume(T* cor);

#endif //__THREADS_H__
