Ignore:
Timestamp:
Apr 24, 2020, 1:54:29 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0ea6c5a
Parents:
ecf6b46
Message:

Added basic statistics to io.cfa

File:
1 edited

Legend:

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

    recf6b46 rd384787  
    10041004}
    10051005
     1006bool V(semaphore & this, unsigned diff) with( this ) {
     1007        $thread * thrd = 0p;
     1008        lock( lock __cfaabi_dbg_ctx2 );
     1009        int release = max(-count, (int)diff);
     1010        count += diff;
     1011        for(release) {
     1012                unpark( pop_head( waiting ) __cfaabi_dbg_ctx2 );
     1013        }
     1014
     1015        unlock( lock );
     1016
     1017        return thrd != 0p;
     1018}
     1019
    10061020//-----------------------------------------------------------------------------
    10071021// Global Queues
Note: See TracChangeset for help on using the changeset viewer.