Changeset bd4d011 for src/tests


Ignore:
Timestamp:
Mar 23, 2017, 3:05:36 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
ae6f1ec
Parents:
bcda04c
Message:

Implemented thread keyword

Location:
src/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/tests/monitor.c

    rbcda04c rbd4d011  
    2626}
    2727
    28 struct MyThread { thread_desc __thrd; };
    29 
    30 DECL_THREAD(MyThread);
    31 
    32 void ?{}( MyThread * this ) {}
    33 void ^?{}( MyThread * mutex this ) {}
     28thread MyThread {};
    3429
    3530void main( MyThread* this ) {
     
    4338        processor p;
    4439        {
    45                 scoped(MyThread) f[4];
     40                MyThread f[4];
    4641        }
    4742        sout | global.value | endl;
  • src/tests/thread.c

    rbcda04c rbd4d011  
    44#include <thread>
    55
    6 struct First { thread_desc __thrd; signal_once* lock; };
    7 struct Second { thread_desc __thrd; signal_once* lock; };
     6// thread First;
     7// void main(First* this);
    88
    9 DECL_THREAD(First);
    10 DECL_THREAD(Second);
     9// thread Second;
     10// void main(Second* this);
     11
     12thread First  { signal_once* lock; };
     13thread Second { signal_once* lock; };
    1114
    1215void ?{}( First * this, signal_once* lock ) { this->lock = lock; }
    1316void ?{}( Second * this, signal_once* lock ) { this->lock = lock; }
    14 
    15 void ^?{}( First  * mutex this ) {}
    16 void ^?{}( Second * mutex this ) {}
    1717
    1818void main(First* this) {
     
    3939                processor p;
    4040                {
    41                         scoped(First)  f = { &lock };
    42                         scoped(Second) s = { &lock };
     41                        First  f = { &lock };
     42                        Second s = { &lock };
    4343                }
    4444        }
Note: See TracChangeset for help on using the changeset viewer.