//                              -*- Mode: CFA -*-
//
// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
//
// The contents of this file are covered under the licence agreement in the
// file "LICENCE" distributed with Cforall.
//
// threads --
//
// Author           : Thierry Delisle
// Created On       : Tue Jan 17 12:27:26 2016
// Last Modified By : Thierry Delisle
// Last Modified On : --
// Update Count     : 0
//

#ifndef KERNEL_H
#define KERNEL_H

#include <stdbool.h>

#include "invoke.h"

//-----------------------------------------------------------------------------
// Cluster
struct cluster {
	simple_thread_list ready_queue;
};

void ?{}(cluster * this);
void ^?{}(cluster * this);

//-----------------------------------------------------------------------------
// Processor
struct processor {
	struct processorCtx_t * ctx;
	cluster * cltr;
	coroutine * current_coroutine;
	thread_h * current_thread;
	bool terminated;
};

void ?{}(processor * this, cluster * cltr);
void ^?{}(processor * this);


//-----------------------------------------------------------------------------
// Locks

void ?{}(simple_lock * this);
void ^?{}(simple_lock * this);

void lock( simple_lock * );
void unlock( simple_lock * );

#endif //KERNEL_H

// Local Variables: //
// mode: c //
// tab-width: 4 //
// End: //
