Ignore:
Timestamp:
Aug 11, 2017, 10:10:26 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
fd344aa
Parents:
8499c707
Message:

Fix concurrency library, tests, and keywords for references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/thread.c

    r8499c707 r83a071f9  
    77thread Second { semaphore* lock; };
    88
    9 void ?{}( First & this, semaphore* lock ) { this.lock = lock; }
    10 void ?{}( Second & this, semaphore* lock ) { this.lock = lock; }
     9void ?{}( First & this, semaphore & lock ) { this.lock = &lock; }
     10void ?{}( Second & this, semaphore & lock ) { this.lock = &lock; }
    1111
    12 void main(First* this) {
     12void main(First& this) {
    1313        for(int i = 0; i < 10; i++) {
    1414                sout | "First : Suspend No." | i + 1 | endl;
    1515                yield();
    1616        }
    17         V(this->lock);
     17        V(this.lock);
    1818}
    1919
    20 void main(Second* this) {
    21         P(this->lock);
     20void main(Second& this) {
     21        P(this.lock);
    2222        for(int i = 0; i < 10; i++) {
    2323                sout | "Second : Suspend No." | i + 1 | endl;
     
    3333                processor p;
    3434                {
    35                         First  f = { &lock };
    36                         Second s = { &lock };
     35                        First  f = { lock };
     36                        Second s = { lock };
    3737                }
    3838        }
Note: See TracChangeset for help on using the changeset viewer.