Ignore:
Timestamp:
May 5, 2020, 4:45:52 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:
6e33a2d
Parents:
4e74466
Message:

Semaphore P() now returned whether or not it block

Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

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

    r4e74466 r71c8b7e  
    987987void ^?{}(semaphore & this) {}
    988988
    989 void P(semaphore & this) with( this ){
     989bool P(semaphore & this) with( this ){
    990990        lock( lock __cfaabi_dbg_ctx2 );
    991991        count -= 1;
     
    997997                unlock( lock );
    998998                park( __cfaabi_dbg_ctx );
     999                return true;
    9991000        }
    10001001        else {
    10011002            unlock( lock );
     1003            return false;
    10021004        }
    10031005}
  • libcfa/src/concurrency/kernel.hfa

    r4e74466 r71c8b7e  
    3838void  ?{}(semaphore & this, int count = 1);
    3939void ^?{}(semaphore & this);
    40 void   P (semaphore & this);
     40bool   P (semaphore & this);
    4141bool   V (semaphore & this);
    4242bool   V (semaphore & this, unsigned count);
Note: See TracChangeset for help on using the changeset viewer.