Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/monitor.cfa

    rc18bf9e r708ae38  
    4444static inline void restore( monitor$ * ctx [], __lock_size_t count, __spinlock_t * locks [], unsigned int /*in */ recursions [], __waitfor_mask_t /*in */ masks [] );
    4545
    46 static inline void ?{}(__condition_node_t & this, thread$ * waiting_thread, __lock_size_t count, uintptr_t user_info );
    47 static inline void ?{}(__condition_criterion_t & this );
    48 static inline void ?{}(__condition_criterion_t & this, monitor$ * target, __condition_node_t * owner );
    49 
    5046static inline void init     ( __lock_size_t count, monitor$ * monitors [], __condition_node_t & waiter, __condition_criterion_t criteria [] );
    5147static inline void init_push( __lock_size_t count, monitor$ * monitors [], __condition_node_t & waiter, __condition_criterion_t criteria [] );
     
    247243
    248244// Leave single monitor
    249 static void __leave( monitor$ * this ) {
     245void __leave( monitor$ * this ) {
    250246        // Lock the monitor spinlock
    251247        lock( this->lock __cfaabi_dbg_ctx2 );
     
    282278
    283279// Leave single monitor for the last time
    284 static void __dtor_leave( monitor$ * this, bool join ) {
     280void __dtor_leave( monitor$ * this, bool join ) {
    285281        __cfaabi_dbg_debug_do(
    286282                if( active_thread() != this->owner ) {
     
    348344// Ctor for monitor guard
    349345// Sorts monitors before entering
    350 void ?{}( monitor_guard_t & this, monitor$ * m [], __lock_size_t count, fptr_t func ) libcfa_public {
     346void ?{}( monitor_guard_t & this, monitor$ * m [], __lock_size_t count, fptr_t func ) {
    351347        thread$ * thrd = active_thread();
    352348
     
    373369}
    374370
    375 void ?{}( monitor_guard_t & this, monitor$ * m [], __lock_size_t count ) libcfa_public {
     371void ?{}( monitor_guard_t & this, monitor$ * m [], __lock_size_t count ) {
    376372        this{ m, count, 0p };
    377373}
     
    379375
    380376// Dtor for monitor guard
    381 void ^?{}( monitor_guard_t & this ) libcfa_public {
     377void ^?{}( monitor_guard_t & this ) {
    382378        // __cfaabi_dbg_print_safe( "MGUARD : leaving %d\n", this.count);
    383379
     
    393389// Ctor for monitor guard
    394390// Sorts monitors before entering
    395 void ?{}( monitor_dtor_guard_t & this, monitor$ * m [], fptr_t func, bool join ) libcfa_public {
     391void ?{}( monitor_dtor_guard_t & this, monitor$ * m [], fptr_t func, bool join ) {
    396392        // optimization
    397393        thread$ * thrd = active_thread();
     
    413409
    414410// Dtor for monitor guard
    415 void ^?{}( monitor_dtor_guard_t & this ) libcfa_public {
     411void ^?{}( monitor_dtor_guard_t & this ) {
    416412        // Leave the monitors in order
    417413        __dtor_leave( this.m, this.join );
     
    423419//-----------------------------------------------------------------------------
    424420// Internal scheduling types
    425 static void ?{}(__condition_node_t & this, thread$ * waiting_thread, __lock_size_t count, uintptr_t user_info ) {
     421void ?{}(__condition_node_t & this, thread$ * waiting_thread, __lock_size_t count, uintptr_t user_info ) {
    426422        this.waiting_thread = waiting_thread;
    427423        this.count = count;
     
    430426}
    431427
    432 static void ?{}(__condition_criterion_t & this ) with( this ) {
     428void ?{}(__condition_criterion_t & this ) with( this ) {
    433429        ready  = false;
    434430        target = 0p;
     
    437433}
    438434
    439 static void ?{}(__condition_criterion_t & this, monitor$ * target, __condition_node_t & owner ) {
     435void ?{}(__condition_criterion_t & this, monitor$ * target, __condition_node_t & owner ) {
    440436        this.ready  = false;
    441437        this.target = target;
     
    446442//-----------------------------------------------------------------------------
    447443// Internal scheduling
    448 void wait( condition & this, uintptr_t user_info = 0 ) libcfa_public {
     444void wait( condition & this, uintptr_t user_info = 0 ) {
    449445        brand_condition( this );
    450446
     
    500496}
    501497
    502 bool signal( condition & this ) libcfa_public {
     498bool signal( condition & this ) {
    503499        if( is_empty( this ) ) { return false; }
    504500
     
    542538}
    543539
    544 bool signal_block( condition & this ) libcfa_public {
     540bool signal_block( condition & this ) {
    545541        if( !this.blocked.head ) { return false; }
    546542
     
    590586
    591587// Access the user_info of the thread waiting at the front of the queue
    592 uintptr_t front( condition & this ) libcfa_public {
     588uintptr_t front( condition & this ) {
    593589        verifyf( !is_empty(this),
    594590                "Attempt to access user data on an empty condition.\n"
     
    612608//              setup mask
    613609//              block
    614 void __waitfor_internal( const __waitfor_mask_t & mask, int duration ) libcfa_public {
     610void __waitfor_internal( const __waitfor_mask_t & mask, int duration ) {
    615611        // This statment doesn't have a contiguous list of monitors...
    616612        // Create one!
     
    998994// Can't be accepted since a mutex stmt is effectively an anonymous routine
    999995// Thus we do not need a monitor group
    1000 void lock( monitor$ * this ) libcfa_public {
     996void lock( monitor$ * this ) {
    1001997        thread$ * thrd = active_thread();
    1002998
     
    10501046// Leave routine for mutex stmt
    10511047// Is just a wrapper around __leave for the is_lock trait to see
    1052 void unlock( monitor$ * this ) libcfa_public { __leave( this ); }
     1048void unlock( monitor$ * this ) { __leave( this ); }
    10531049
    10541050// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.