Changeset a362f97 for src/libcfa/concurrency/invoke.h
- Timestamp:
- Jan 27, 2017, 3:27:34 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- c0aa336
- Parents:
- 6acb935 (diff), 0a86a30 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/invoke.h
r6acb935 ra362f97 1 // -*- Mode: C -*- 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 // invoke.h -- 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 1 17 #include <stdbool.h> 2 18 #include <stdint.h> … … 11 27 12 28 #define unlikely(x) __builtin_expect(!!(x), 0) 29 #define thread_local _Thread_local 30 #define SCHEDULER_CAPACITY 10 31 32 struct simple_thread_list { 33 struct thread * head; 34 struct thread ** tail; 35 }; 36 37 #ifdef __CFORALL__ 38 extern "Cforall" { 39 void ?{}( struct simple_thread_list * ); 40 void append( struct simple_thread_list *, struct thread * ); 41 struct thread * pop_head( struct simple_thread_list * ); 42 } 43 #endif 13 44 14 45 struct coStack_t { … … 35 66 }; 36 67 37 struct thread_h { 68 struct simple_lock { 69 struct simple_thread_list blocked; 70 }; 71 72 struct thread { 38 73 struct coroutine c; 74 struct simple_lock lock; 75 struct thread * next; 39 76 }; 40 77 … … 52 89 // assembler routines that performs the context switch 53 90 extern void CtxInvokeStub( void ); 54 void CtxSwitch( void *from, void *to ) asm ("CtxSwitch"); 91 void CtxSwitch( void * from, void * to ) asm ("CtxSwitch"); 92 void CtxGet( void * this ) asm ("CtxGet"); 55 93 56 94 #endif //_INVOKE_PRIVATE_H_
Note: See TracChangeset
for help on using the changeset viewer.