Ignore:
Timestamp:
Mar 16, 2017, 5:20:16 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:
3743983
Parents:
1fbab5a
Message:

Implemented monitor keyword, and it works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/multi-monitor.c

    r1fbab5a ref42b143  
    66static int global12, global23, global13;
    77
    8 static monitor_desc m1, m2, m3;
     8struct monitor_t {
     9        monitor_desc m;
     10};
    911
    10 void increment( /*mutex*/ monitor_desc * p1, /*mutex*/ monitor_desc * p2, int * value ) {
    11         monitor_desc * mons[] = { p1, p2 };
    12         monitor_guard_t g = { mons, 2 };
     12monitor_desc * get_monitor( monitor_t * this ) {
     13        return &this->m;
     14}
     15
     16static monitor_t m1, m2, m3;
     17
     18void increment( monitor_t * mutex p1, monitor_t * mutex p2, int * value ) {
    1319        *value += 1;
    1420}
Note: See TracChangeset for help on using the changeset viewer.