source: src/libcfa/concurrency/kernel @ 75f3522

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 75f3522 was 75f3522, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

Moved several declarations to a new private header and made some clean-up

  • 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 2017
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// Locks
62
63void ?{}(simple_lock * this);
64void ^?{}(simple_lock * this);
65
66void lock( simple_lock * );
67void unlock( simple_lock * );
68
69#endif //KERNEL_H
70
71// Local Variables: //
72// mode: c //
73// tab-width: 4 //
74// End: //
Note: See TracBrowser for help on using the repository browser.