Changes in / [1eb222ff:02a43ff]
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/alarm.cfa
r1eb222ff r02a43ff 119 119 insert( &alarms, this ); 120 120 __kernel_set_timer( this->timeval - curr); 121 this->set = true; 121 122 } 122 123 unlock( event_kernel->lock ); 123 this->set = true;124 124 enable_interrupts(); 125 125 } … … 130 130 { 131 131 verify( validate( event_kernel->alarms ) ); 132 remove( *this ); 132 if (this->set) remove( *this ); 133 this->set = false; 133 134 } 134 135 unlock( event_kernel->lock ); 135 136 enable_interrupts(); 136 this->set = false;137 137 } 138 138 -
libcfa/src/concurrency/locks.cfa
r1eb222ff r02a43ff 313 313 314 314 // helper for wait()'s' with a timeout 315 void queue_info_thread_timeout( condition_variable(L) & this, info_thread(L) & info, Duration t ) with(this) {315 void queue_info_thread_timeout( condition_variable(L) & this, info_thread(L) & info, Duration t, Alarm_Callback callback ) with(this) { 316 316 lock( lock __cfaabi_dbg_ctx2 ); 317 317 size_t recursion_count = queue_and_get_recursion(this, &info); 318 alarm_node_wrap(L) node_wrap = { t, 0`s, alarm_node_wrap_cast, &this, &info };318 alarm_node_wrap(L) node_wrap = { t, 0`s, callback, &this, &info }; 319 319 register_self( &node_wrap.alarm_node ); 320 320 unlock( lock ); … … 332 332 #define WAIT_TIME( u, l, t ) \ 333 333 info_thread( L ) i = { active_thread(), u, l }; \ 334 queue_info_thread_timeout(this, i, t ); \334 queue_info_thread_timeout(this, i, t, alarm_node_wrap_cast ); \ 335 335 return i.signalled; 336 336 -
src/GenPoly/Box.cc
r1eb222ff r02a43ff 1525 1525 stmtsToAddBefore.push_back( new DeclStmt( newBuf ) ); 1526 1526 1527 // if the object has a cleanup attribute, the cleanup should be on the buffer, not the pointer 1528 auto matchAndMove = [newBuf](Attribute * attr){ 1529 if(attr->name == "cleanup") { 1530 newBuf->attributes.push_back(attr); 1531 return true; 1532 } 1533 return false; 1534 }; 1535 1536 objectDecl->attributes.remove_if(matchAndMove); 1537 1527 1538 delete objectDecl->get_init(); 1528 1539 objectDecl->set_init( new SingleInit( new VariableExpr( newBuf ) ) ); -
tests/unified_locking/timeout_lock.cfa
r1eb222ff r02a43ff 33 33 34 34 for ( unsigned int i = 0; i < NoOfTimes + 3; i += 1 ) { 35 if ( wait( c_m, m, 1`s ) ) { 35 if ( wait( c_m, m, 1`s ) ) { 36 36 // printf("Thread: %p signalled\n", active_thread()); // removed since can't expect non deterministic output 37 37 } else { … … 73 73 processor p[2]; 74 74 printf("Start Test 1: surface testing condition variable timeout routines\n"); 75 wait( c_m, 1`ns ); // bool wait( condition_variable(L) & this, Duration duration ); 75 wait( c_m, 1`ns ); // bool wait( condition_variable(L) & this, Duration duration ); 76 76 wait( c_m, 10, 1`ns ); // bool wait( condition_variable(L) & this, uintptr_t info, Duration duration ); 77 wait( c_m, __kernel_get_time() + 1`ns ); // bool wait( condition_variable(L) & this, Time time );78 wait( c_m, 10, __kernel_get_time() + 1`ns ); // bool wait( condition_variable(L) & this, uintptr_t info, Time time );79 77 lock(m); wait( c_m, m, 1`ns ); unlock(m); // bool wait( condition_variable(L) & this, L & l, Duration duration ); 80 78 lock(m); wait( c_m, m, 10, 1`ns ); unlock(m); // bool wait( condition_variable(L) & this, L & l, uintptr_t info, Duration duration ); 81 lock(m); wait( c_m, m, __kernel_get_time() + 1`ns ); unlock(m); // bool wait( condition_variable(L) & this, L & l, Time time );82 lock(m); wait( c_m, m, 10, __kernel_get_time() + 1`ns ); unlock(m); // bool wait( condition_variable(L) & this, L & l, uintptr_t info, Time time );83 79 printf("Done Test 1\n"); 84 80
Note: See TracChangeset
for help on using the changeset viewer.