Changeset e5d9274 for libcfa/src/concurrency/locks.cfa
- Timestamp:
- Jun 2, 2022, 3:11:21 PM (23 months ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- ced5e2a
- Parents:
- 015925a (diff), fc134a48 (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
-
libcfa/src/concurrency/locks.cfa
r015925a re5d9274 24 24 #include <stdlib.hfa> 25 25 26 #pragma GCC visibility push(default) 27 26 28 //----------------------------------------------------------------------------- 27 29 // info_thread … … 116 118 } 117 119 118 void pop_and_set_new_owner( blocking_lock & this ) with( this ) {120 static void pop_and_set_new_owner( blocking_lock & this ) with( this ) { 119 121 thread$ * t = &try_pop_front( blocked_threads ); 120 122 owner = t; … … 264 266 void ^?{}( alarm_node_wrap(L) & this ) { } 265 267 266 void timeout_handler ( alarm_node_wrap(L) & this ) with( this ) {268 static void timeout_handler ( alarm_node_wrap(L) & this ) with( this ) { 267 269 // This condition_variable member is called from the kernel, and therefore, cannot block, but it can spin. 268 270 lock( cond->lock __cfaabi_dbg_ctx2 ); … … 288 290 289 291 // this casts the alarm node to our wrapped type since we used type erasure 290 void alarm_node_wrap_cast( alarm_node_t & a ) { timeout_handler( (alarm_node_wrap(L) &)a ); }292 static void alarm_node_wrap_cast( alarm_node_t & a ) { timeout_handler( (alarm_node_wrap(L) &)a ); } 291 293 } 292 294 … … 305 307 void ^?{}( condition_variable(L) & this ){ } 306 308 307 void process_popped( condition_variable(L) & this, info_thread(L) & popped ) with( this ) {309 static void process_popped( condition_variable(L) & this, info_thread(L) & popped ) with( this ) { 308 310 if(&popped != 0p) { 309 311 popped.signalled = true; … … 350 352 int counter( condition_variable(L) & this ) with(this) { return count; } 351 353 352 s ize_t queue_and_get_recursion( condition_variable(L) & this, info_thread(L) * i ) with(this) {354 static size_t queue_and_get_recursion( condition_variable(L) & this, info_thread(L) * i ) with(this) { 353 355 // add info_thread to waiting queue 354 356 insert_last( blocked_threads, *i ); … … 363 365 364 366 // helper for wait()'s' with no timeout 365 void queue_info_thread( condition_variable(L) & this, info_thread(L) & i ) with(this) {367 static void queue_info_thread( condition_variable(L) & this, info_thread(L) & i ) with(this) { 366 368 lock( lock __cfaabi_dbg_ctx2 ); 367 369 size_t recursion_count = queue_and_get_recursion(this, &i); … … 380 382 381 383 // helper for wait()'s' with a timeout 382 void queue_info_thread_timeout( condition_variable(L) & this, info_thread(L) & info, Duration t, Alarm_Callback callback ) with(this) {384 static void queue_info_thread_timeout( condition_variable(L) & this, info_thread(L) & info, Duration t, Alarm_Callback callback ) with(this) { 383 385 lock( lock __cfaabi_dbg_ctx2 ); 384 386 size_t recursion_count = queue_and_get_recursion(this, &info); … … 415 417 // fast_cond_var 416 418 void ?{}( fast_cond_var(L) & this ){ 417 this.blocked_threads{}; 419 this.blocked_threads{}; 418 420 #ifdef __CFA_DEBUG__ 419 421 this.lock_used = 0p;
Note: See TracChangeset
for help on using the changeset viewer.