Changeset fcd0b9d7
- Timestamp:
- Jan 18, 2021, 3:34:57 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 4b1c8da
- Parents:
- e35a32b
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/thread.cfa
re35a32b rfcd0b9d7 83 83 forall(dtype T | is_thread(T) | IS_EXCEPTION(ThreadCancelled, (T))) 84 84 void ?{}( thread_dtor_guard_t & this, 85 T & thrd, void(* defaultResumptionHandler)(ThreadCancelled(T) &)) {86 $monitor * m = get_monitor(thrd);85 T & thrd, void(*cancelHandler)(ThreadCancelled(T) &)) { 86 $monitor * m = get_monitor(thrd); 87 87 $thread * desc = get_thread(thrd); 88 88 89 89 // Setup the monitor guard 90 90 void (*dtor)(T& mutex this) = ^?{}; 91 bool join = defaultResumptionHandler != (void(*)(ThreadCancelled(T)&))0;91 bool join = cancelHandler != (void(*)(ThreadCancelled(T)&))0; 92 92 (this.mg){&m, (void(*)())dtor, join}; 93 93 … … 103 103 } 104 104 desc->state = Cancelled; 105 if (!join) { 106 defaultResumptionHandler = default_thread_cancel_handler; 107 } 105 void(*defaultResumptionHandler)(ThreadCancelled(T) &) = 106 join ? cancelHandler : default_thread_cancel_handler; 108 107 109 108 ThreadCancelled(T) except; -
src/ResolvExpr/PolyCost.cc
re35a32b rfcd0b9d7 35 35 PassVisitor<PolyCost> coster( env, indexer ); 36 36 type->accept( coster ); 37 return coster.pass.result;37 return (coster.pass.result > 0) ? 1 : 0; 38 38 } 39 39 … … 87 87 ast::Pass<PolyCost_new> costing( symtab, env ); 88 88 type->accept( costing ); 89 return costing.core.result;89 return (costing.core.result > 0) ? 1 : 0; 90 90 } 91 91 -
tests/.expect/poly-selection.txt
re35a32b rfcd0b9d7 1 1 friending generically 2 2 friending specifically 3 - 4 f-generic 5 f-specific -
tests/avltree/avl.h
re35a32b rfcd0b9d7 57 57 void ?{}(tree(K, V) &t, K key, V value); 58 58 59 forall(otype K , otype V)59 forall(otype K | Comparable(K), otype V) 60 60 void ^?{}(tree(K, V) & t); 61 61 -
tests/avltree/avl1.cfa
re35a32b rfcd0b9d7 13 13 } 14 14 15 forall(otype K , otype V)15 forall(otype K| Comparable(K), otype V) 16 16 void ^?{}(tree(K, V) & t){ 17 17 delete(t.left); -
tests/poly-selection.cfa
re35a32b rfcd0b9d7 35 35 } 36 36 37 void testSpecializationFromGenericAccessibleWithExtraTyvars() { 38 39 forall( dtype T, dtype U ) 40 struct map {}; 41 42 forall( dtype T ) 43 void f( T & ) { 44 printf("f-generic\n"); 45 } 46 47 forall( dtype T ) 48 void f( map(T, T) & ) { 49 printf("f-specific\n"); 50 } 51 52 float one; 53 map(float, float) two; 54 f(one); 55 f(two); 56 } 37 57 38 58 int main() { 39 59 testSpecializationFromGenericOverBareTyvar(); 60 printf("-\n"); 61 testSpecializationFromGenericAccessibleWithExtraTyvars(); 40 62 }
Note: See TracChangeset
for help on using the changeset viewer.