source: src/libcfa/concurrency/kernel @ 992b089

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 992b089 was 9e45e46, checked in by Thierry Delisle <tdelisle@…>, 8 years ago

Removed unnecessary code/comments

  • Property mode set to 100644
File size: 1.5 KB
Line 
1//                              -*- Mode: CFA -*-
2//
3// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
4//
5// The contents of this file are covered under the licence agreement in the
6// file "LICENCE" distributed with Cforall.
7//
8// threads --
9//
10// Author           : Thierry Delisle
11// Created On       : Tue Jan 17 12:27:26 2016
12// Last Modified By : Thierry Delisle
13// Last Modified On : --
14// Update Count     : 0
15//
16
17#ifndef KERNEL_H
18#define KERNEL_H
19
20#include <stdbool.h>
21
22#include "invoke.h"
23
24extern "C" {
25#include <pthread.h>
26}
27
28//-----------------------------------------------------------------------------
29// Cluster
30struct cluster {
31        simple_thread_list ready_queue;
32        // pthread_spinlock_t lock;
33};
34
35void ?{}(cluster * this);
36void ^?{}(cluster * this);
37
38//-----------------------------------------------------------------------------
39// Processor
40enum ProcessorAction {
41        Reschedule,
42        NoAction
43};
44
45struct processor {
46        struct processorCtx_t * runner;
47        cluster * cltr;
48        coroutine * current_coroutine;
49        thread * current_thread;
50        pthread_t kernel_thread;
51        simple_lock lock;
52        volatile bool terminated;
53        ProcessorAction thread_action;
54};
55
56void ?{}(processor * this);
57void ?{}(processor * this, cluster * cltr);
58void ^?{}(processor * this);
59
60
61//-----------------------------------------------------------------------------
62// Locks
63
64void ?{}(simple_lock * this);
65void ^?{}(simple_lock * this);
66
67void lock( simple_lock * );
68void unlock( simple_lock * );
69
70#endif //KERNEL_H
71
72// Local Variables: //
73// mode: c //
74// tab-width: 4 //
75// End: //
Note: See TracBrowser for help on using the repository browser.