Changes in / [c41c2dbe:e638266]


Ignore:
Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/locks.hfa

    rc41c2dbe re638266  
    197197static inline $thread * unlock( fast_lock & this ) __attribute__((artificial));
    198198static inline $thread * unlock( fast_lock & this ) {
    199         /* paranoid */ verify(active_thread() == this.owner);
     199        $thread * thrd = active_thread();
     200        /* paranoid */ verify(thrd == this.owner);
    200201
    201202        // open 'owner' before unlocking anyone
  • libcfa/src/concurrency/ready_queue.cfa

    rc41c2dbe re638266  
    413413                        unsigned it2  = proc->rdq.itr + 1;
    414414                        unsigned idx1 = proc->rdq.id + (it1 % READYQ_SHARD_FACTOR);
    415                         unsigned idx2 = proc->rdq.id + (it2 % READYQ_SHARD_FACTOR);
     415                        unsigned idx2 = proc->rdq.id + (it1 % READYQ_SHARD_FACTOR);
    416416                        unsigned long long tsc1 = ts(lanes.data[idx1]);
    417417                        unsigned long long tsc2 = ts(lanes.data[idx2]);
    418418                        proc->rdq.cutoff = min(tsc1, tsc2);
    419                         if(proc->rdq.cutoff == 0) proc->rdq.cutoff = -1ull;
    420                 }
    421                 else {
    422                         unsigned target = proc->rdq.target;
     419                }
     420                else if(lanes.tscs[proc->rdq.target].tv < proc->rdq.cutoff) {
     421                        $thread * t = try_pop(cltr, proc->rdq.target __STATS(, __tls_stats()->ready.pop.help));
    423422                        proc->rdq.target = -1u;
    424                         if(lanes.tscs[target].tv < proc->rdq.cutoff) {
    425                                 $thread * t = try_pop(cltr, target __STATS(, __tls_stats()->ready.pop.help));
    426                                 if(t) return t;
    427                         }
     423                        if(t) return t;
    428424                }
    429425
Note: See TracChangeset for help on using the changeset viewer.