Ignore:
Timestamp:
Oct 10, 2018, 3:11:53 PM (6 years ago)
Author:
alain
Message:

1) Improve the busylock debug infrastructure.
2) introduce a non-distributed, but portable implementation for the pthread_barrier.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/remote_mutex.c

    r563 r581  
    191191void remote_mutex_lock( xptr_t mutex_xp )
    192192{
     193    // get cluster and pointers on calling thread
     194    cxy_t            caller_cxy = local_cxy;
     195    thread_t       * caller_ptr = CURRENT_THREAD;
     196    xptr_t           caller_xp  = XPTR( caller_cxy , caller_ptr );
     197
     198    // check calling thread can yield
     199    thread_assert_can_yield( caller_ptr , __FUNCTION__ );
     200
    193201    // get cluster and local pointer on mutex
    194202    remote_mutex_t * mutex_ptr = GET_PTR( mutex_xp );
     
    200208    xptr_t           root_xp  = XPTR( mutex_cxy , &mutex_ptr->root );
    201209    xptr_t           lock_xp  = XPTR( mutex_cxy , &mutex_ptr->lock );
    202 
    203     // get cluster and pointers on calling thread
    204     cxy_t            caller_cxy = local_cxy;
    205     thread_t       * caller_ptr = CURRENT_THREAD;
    206     xptr_t           caller_xp  = XPTR( caller_cxy , caller_ptr );
    207 
    208 // check calling thread can yield
    209 assert( (caller_ptr->busylocks == 0),
    210 "cannot yield : busylocks = %d\n", caller_ptr->busylocks );
    211210
    212211    while( 1 )
Note: See TracChangeset for help on using the changeset viewer.