Changeset bd4d011 for src/tests/thread.c


Ignore:
Timestamp:
Mar 23, 2017, 3:05:36 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
ae6f1ec
Parents:
bcda04c
Message:

Implemented thread keyword

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.