Changeset 3d4b23fa for src/tests


Ignore:
Timestamp:
Jul 13, 2017, 3:57:04 PM (8 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:
0720e049, 9a1e509
Parents:
55a68c3 (diff), d6ff3ff (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

Location:
src/tests
Files:
4 added
17 edited

Legend:

Unmodified
Added
Removed
  • src/tests/.expect/32/math.txt

    r55a68c3 r3d4b23fa  
    2222cos:0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i
    2323tan:1.55741 1.5574077246549 1.55740772465490223 0.271753+1.08392i 0.271752585319512+1.08392332733869i 0.271752585319511717+1.08392332733869454i
    24 asin:1.5708 1.5707963267949 1.57079632679489662 0.66624+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i
     24asin:1.5708 1.5707963267949 1.57079632679489662 0.666239+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i
    2525acos:0 0 0 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i
    2626atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
  • src/tests/.expect/concurrent/sched-int-disjoint.txt

    r55a68c3 r3d4b23fa  
    999000
    101010000
    11 11000
    12 12000
    13 13000
    14 14000
    15 15000
    16 16000
    17 17000
    18 18000
    19 19000
    20 20000
    21 21000
    22 22000
    23 23000
    24 24000
    25 25000
    26 26000
    27 27000
    28 28000
    29 29000
    30 30000
    31 31000
    32 32000
    33 33000
    34 34000
    35 35000
    36 36000
    37 37000
    38 38000
    39 39000
    40 40000
    41 41000
    42 42000
    43 43000
    44 44000
    45 45000
    46 46000
    47 47000
    48 48000
    49 49000
    50 50000
    51 51000
    52 52000
    53 53000
    54 54000
    55 55000
    56 56000
    57 57000
    58 58000
    59 59000
    60 60000
    61 61000
    62 62000
    63 63000
    64 64000
    65 65000
    66 66000
    67 67000
    68 68000
    69 69000
    70 70000
    71 71000
    72 72000
    73 73000
    74 74000
    75 75000
    76 76000
    77 77000
    78 78000
    79 79000
    80 80000
    81 81000
    82 82000
    83 83000
    84 84000
    85 85000
    86 86000
    87 87000
    88 88000
    89 89000
    90 90000
    91 91000
    92 92000
    93 93000
    94 94000
    95 95000
    96 96000
    97 97000
    98 98000
    99 99000
    100 100000
    10111All waiter done
  • src/tests/.expect/io.txt

    r55a68c3 r3d4b23fa  
    44123
    55
    6 opening delimiters 
     6opening delimiters
    77x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «10
    88
    9 closing delimiters 
    10 1, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x 
     9closing delimiters
     101, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x
    1111
    12 opening/closing delimiters 
     12opening/closing delimiters
    1313x`1`x'2'x"3"x:4:x 5 x   6       x
    14147
     
    1919x
    202010
    21 x 
     21x
    2222
    23 override opening/closing delimiters 
     23override opening/closing delimiters
    2424x ( 1 ) x 2 , x 3 :x: 4
    2525
    26 input bacis types 
     26input bacis types
    2727
    28 output basic types 
     28output basic types
    2929A
    30301 2 3 4 5 6 7 8
     
    32321.1+2.3i 1.1-2.3i 1.1-2.3i
    3333
    34 tuples 
    35 1, 2, 3 3, 4, 5
     34tuples
     351, 2, 3 4, 5, 6
    3636
    37 toggle separator 
     37toggle separator
    38381.11.21.3
    39391.1+2.3i1.1-2.3i1.1-2.3i
    40  abcxyz
    41 abcxyz
     401.1+2.3i 1.1-2.3i1.1-2.3i
     411.1+2.3i 1.1-2.3i 1.1-2.3i
     421.1+2.3i1.1-2.3i 1.1-2.3i
     43abcxyz
     44abcxyz
    4245
    43 change separator 
    44 from "  "to " , $"
     46change separator
     47from " " to ", $"
    45481.1, $1.2, $1.3
    46491.1+2.3i, $1.1-2.3i, $1.1-2.3i
    47 abc, $xyz, $
    48 1, 2, 3, $3, 4, 5
     50abc, $xyz
     511, 2, 3, $4, 5, 6
    4952
    50 from ", $"to " "
     53from ", $" to " "
    51541.1 1.2 1.3
    52551.1+2.3i 1.1-2.3i 1.1-2.3i
    53 abc xyz 
    54 1, 2, 3 3, 4, 5
     56abc xyz
     571, 2, 3 4, 5, 6
    5558
    56  1 2 3
     59check sepOn/sepOff
     601 2 3
    576112 3
    58  1 2 3
    59621 2 3
    60  1 2 3
     631 2 3
    6164
     651 2 3
     66
     67check enable/disable
    6268123
    63691 23
     
    6571123
    66721 2 3
    67 123 
     73123
    68741 2 3
    6975
    70 1 2 3 3 4 5 " "
    71 1, 2, 3 3, 4, 5 ", "
    72 1, 2, 3 3, 4, 5
     761 2 3 4 5 6 " "
     771, 2, 3 4, 5, 6 " "
     781, 2, 3 4, 5, 6
    7379
    74803, 4, a, 7.2
    75813, 4, a, 7.2
    76823 4 a 7.2
    77  3 4 a 7.234a7.23 4 a 7.2
     833 4 a 7.234a7.23 4 a 7.2
    78843-4-a-7.2^3^4^3-4-a-7.2
  • src/tests/Makefile.am

    r55a68c3 r3d4b23fa  
    2929
    3030# applies to both programs
    31 EXTRA_FLAGS =
    32 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ ${EXTRA_FLAGS}
     31DEBUG_FLAGS =
     32
     33BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@
     34if !BUILD_DEBUG
     35BUILD_FLAGS += -nodebug
     36else
     37if !BUILD_RELEASE
     38BUILD_FLAGS += -debug
     39else
     40BUILD_FLAGS += ${DEBUG_FLAGS}
     41endif
     42endif
     43
    3344TEST_FLAGS = $(if $(test), 2> .err/${@}.log, )
    3445AM_CFLAGS = ${TEST_FLAGS} ${BUILD_FLAGS}
  • src/tests/Makefile.in

    r55a68c3 r3d4b23fa  
    9292host_triplet = @host@
    9393@BUILD_CONCURRENCY_TRUE@am__append_1 = coroutine thread monitor
     94@BUILD_DEBUG_FALSE@am__append_2 = -nodebug
     95@BUILD_DEBUG_TRUE@@BUILD_RELEASE_FALSE@am__append_3 = -debug
     96@BUILD_DEBUG_TRUE@@BUILD_RELEASE_TRUE@am__append_4 = ${DEBUG_FLAGS}
    9497EXTRA_PROGRAMS = fstream_test$(EXEEXT) vector_test$(EXEEXT) \
    9598        avl_test$(EXEEXT)
     
    320323
    321324# applies to both programs
    322 EXTRA_FLAGS =
    323 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ ${EXTRA_FLAGS}
     325DEBUG_FLAGS =
     326BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ \
     327        $(am__append_2) $(am__append_3) $(am__append_4)
    324328TEST_FLAGS = $(if $(test), 2> .err/${@}.log, )
    325329AM_CFLAGS = ${TEST_FLAGS} ${BUILD_FLAGS}
     
    343347          esac; \
    344348        done; \
    345         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tests/Makefile'; \
     349        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/tests/Makefile'; \
    346350        $(am__cd) $(top_srcdir) && \
    347           $(AUTOMAKE) --gnu src/tests/Makefile
     351          $(AUTOMAKE) --foreign src/tests/Makefile
    348352Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
    349353        @case '$?' in \
  • src/tests/io.c

    r55a68c3 r3d4b23fa  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul  2 09:40:58 2017
    13 // Update Count     : 68
     12// Last Modified On : Thu Jul  6 23:26:12 2017
     13// Update Count     : 78
    1414//
    1515
     
    104104
    105105        sout | "tuples" | endl;
    106         [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 3, [ 4, 5 ] ];
     106        [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 4, [ 5, 6 ] ];
    107107        sout | t1 | t2 | endl;                                                          // print tuple
    108108        sout | endl;
     
    110110        sout | "toggle separator" | endl;
    111111        sout | f | "" | d | "" | ld | endl                                      // floating point without separator
    112                 | sepDisable | fc | dc | ldc | sepEnable | endl // complex without separator
    113                 | sepOn | s1 | sepOff | s2 | endl                               // local separator removal
    114                 | s1 | "" | s2 | endl;                                                  // C string without separator
     112                | sepDisable | fc | dc | ldc | endl                             // complex without separator
     113                | fc | sepOn | dc | ldc | endl                                  // local separator add
     114                | sepEnable | fc | dc | ldc | endl                              // complex with separator
     115                | fc | sepOff | dc | ldc | endl                                 // local separator removal
     116                | s1 | sepOff | s2 | endl                                               // local separator removal
     117                | s1 | "" | s2 | endl;                                                  // local separator removal
    115118        sout | endl;
    116119
    117120        sout | "change separator" | endl;
    118         sout | "from \" " | sepGet( sout ) | "\"";
     121        sout | "from \"" | sep | "\"";
    119122        sepSet( sout, ", $" );                                                          // change separator, maximum of 15 characters
    120         sout | "to \" " | sepGet( sout ) | "\"" | endl;
     123        sout | " to \"" | sep | "\"" | endl;
    121124        sout | f | d | ld | endl
    122125                | fc | dc | ldc | endl
     
    124127                | t1 | t2 | endl;                                                               // print tuple
    125128        sout | endl;
    126         sout | "from \"" | sepGet( sout ) | "\"";
     129        sout | "from \"" | sep | "\" ";
    127130        sepSet( sout, " " );                                                            // restore separator
    128         sout | "to \"" | sepGet( sout ) | "\"" | endl;
     131        sout | "to \"" | sep | "\"" | endl;
    129132        sout | f | d | ld | endl
    130133                | fc | dc | ldc | endl
     
    133136        sout | endl;
    134137
    135         sout | sepOn | 1 | 2 | 3 | sepOn | endl;                        // separator at start/end of line
     138        sout | "check sepOn/sepOff" | endl;
     139        sout | sepOn | 1 | 2 | 3 | sepOn | endl;                        // no separator at start/end of line
    136140        sout | 1 | sepOff | 2 | 3 | endl;                                       // locally turn off implicit separator
    137         sout | sepOn | 1 | 2 | 3 | sepOn | sepOff | endl;       // separator at start of line
    138         sout | 1 | 2 | 3 | endl | sepOn;                                        // separator at start of next line
     141        sout | sepOn | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn | '\n'; // no separator at start/end of line
     142        sout | 1 | 2 | 3 | "\n\n" | sepOn;                                      // no separator at start of next line
    139143        sout | 1 | 2 | 3 | endl;
    140144        sout | endl;
    141145
     146        sout | "check enable/disable" | endl;
    142147        sout | sepDisable | 1 | 2 | 3 | endl;                           // globally turn off implicit separation
    143148        sout | 1 | sepOn | 2 | 3 | endl;                                        // locally turn on implicit separator
     
    149154        sout | endl;
    150155
     156//      sout | fmt( d, "%8.3f" ) || endl;
     157//      sout | endl;
     158
    151159        sepSetTuple( sout, " " );                                                       // set tuple separator from ", " to " "
    152         sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"" | endl;
     160        sout | t1 | t2 | " \"" | sep | "\"" | endl;
    153161        sepSetTuple( sout, ", " );                                                      // reset tuple separator to ", "
    154         sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"" | endl;
     162        sout | t1 | t2 | " \"" | sep | "\"" | endl;
    155163        sout | t1 | t2 | endl;                                                          // print tuple
    156164        sout | endl;
  • src/tests/preempt_longrun/Makefile.am

    r55a68c3 r3d4b23fa  
    1010## Author           : Thierry Delisle
    1111## Created On       : Fri Jun 16 10:57:34 2017
    12 ## Last Modified By : 
    13 ## Last Modified On : 
     12## Last Modified By :
     13## Last Modified On :
    1414## Update Count     : 0
    1515###############################################################################
    1616
    1717repeats=10
    18 max_time=30
    19 preempt=10_000ul
     18max_time=600
     19preempt=1_000ul
    2020
    2121REPEAT = ${abs_top_srcdir}/tools/repeat -s
     
    2525CC = @CFA_BINDIR@/@CFA_NAME@
    2626
    27 TESTS = barge block create disjoint processor stack wait yield
     27TESTS = barge block create disjoint enter enter3 processor stack wait yield
    2828
    2929.INTERMEDIATE: ${TESTS}
  • src/tests/preempt_longrun/Makefile.in

    r55a68c3 r3d4b23fa  
    449449top_srcdir = @top_srcdir@
    450450repeats = 10
    451 max_time = 30
    452 preempt = 10_000ul
     451max_time = 600
     452preempt = 1_000ul
    453453REPEAT = ${abs_top_srcdir}/tools/repeat -s
    454454BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -debug -O2 -DPREEMPTION_RATE=${preempt}
    455 TESTS = barge block create disjoint processor stack wait yield
     455TESTS = barge block create disjoint enter enter3 processor stack wait yield
    456456all: all-am
    457457
     
    467467          esac; \
    468468        done; \
    469         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tests/preempt_longrun/Makefile'; \
     469        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/tests/preempt_longrun/Makefile'; \
    470470        $(am__cd) $(top_srcdir) && \
    471           $(AUTOMAKE) --gnu src/tests/preempt_longrun/Makefile
     471          $(AUTOMAKE) --foreign src/tests/preempt_longrun/Makefile
    472472Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
    473473        @case '$?' in \
     
    663663        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
    664664        "$$tst" $(AM_TESTS_FD_REDIRECT)
     665enter.log: enter
     666        @p='enter'; \
     667        b='enter'; \
     668        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
     669        --log-file $$b.log --trs-file $$b.trs \
     670        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
     671        "$$tst" $(AM_TESTS_FD_REDIRECT)
     672enter3.log: enter3
     673        @p='enter3'; \
     674        b='enter3'; \
     675        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
     676        --log-file $$b.log --trs-file $$b.trs \
     677        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
     678        "$$tst" $(AM_TESTS_FD_REDIRECT)
    665679processor.log: processor
    666680        @p='processor'; \
  • src/tests/preempt_longrun/create.c

    r55a68c3 r3d4b23fa  
    1010}
    1111
    12 thread Worker {};
     12thread worker_t {};
    1313
    14 void main(Worker * this) {}
     14void main(worker_t * this) {}
    1515
    1616int main(int argc, char* argv[]) {
    17         for(int i = 0; i < 100_000ul; i++) {
    18                 Worker w;
     17        processor p;
     18        for(int i = 0; i < 10_000ul; i++) {
     19                worker_t w[7];
    1920        }
    2021}
  • src/tests/preempt_longrun/processor.c

    r55a68c3 r3d4b23fa  
    1010}
    1111
    12 thread Worker {};
     12thread worker_t {};
    1313
    14 void main(Worker * this) {}
     14void main(worker_t * this) {}
    1515
    1616int main(int argc, char* argv[]) {
    17         for(int i = 0; i < 100_000ul; i++) {
     17        for(int i = 0; i < 10_000ul; i++) {
    1818                processor p;
    1919        }
  • src/tests/preempt_longrun/stack.c

    r55a68c3 r3d4b23fa  
    1212}
    1313
    14 thread Worker {};
     14thread worker_t {};
    1515
    16 void main(Worker * this) {
     16void main(worker_t * this) {
    1717        volatile long p = 5_021_609ul;
    1818        volatile long a = 326_417ul;
    1919        volatile long n = 1l;
    20         for (volatile long i = 0; i < p; i++) { 
    21                 n *= a; 
    22                 n %= p; 
     20        for (volatile long i = 0; i < p; i++) {
     21                n *= a;
     22                n %= p;
    2323        }
    24                
     24
    2525        if( n != a ) {
    2626                abort();
     
    2828}
    2929
     30extern "C" {
     31static worker_t * workers;
     32}
     33
    3034int main(int argc, char* argv[]) {
    3135        processor p;
    3236        {
    33                 Worker w[7];
     37                worker_t w[7];
     38                workers = w;
    3439        }
    3540}
  • src/tests/preempt_longrun/yield.c

    r55a68c3 r3d4b23fa  
    1010}
    1111
    12 thread Worker {};
     12thread worker_t {};
    1313
    14 void main(Worker * this) {
    15         for(int i = 0; i < 100_000ul; i++) {
     14void main(worker_t * this) {
     15        for(int i = 0; i < 325_000ul; i++) {
    1616                yield();
    1717        }
     18}
     19
     20extern "C" {
     21static worker_t * workers;
    1822}
    1923
     
    2125        processor p;
    2226        {
    23                 Worker w[7];
     27                worker_t w[7];
     28                workers = w;
    2429        }
    2530}
  • src/tests/sched-int-block.c

    r55a68c3 r3d4b23fa  
    66
    77#ifndef N
    8 #define N 100_000
     8#define N 10_000
    99#endif
    1010
     
    3131//------------------------------------------------------------------------------
    3232void wait_op( global_data_t * mutex a, global_data_t * mutex b, unsigned i ) {
    33         wait( &cond, (uintptr_t)this_thread() );
     33        wait( &cond, (uintptr_t)this_thread );
    3434
    3535        yield( ((unsigned)rand48()) % 10 );
     
    4040        }
    4141
    42         a->last_thread = b->last_thread = this_thread();
     42        a->last_thread = b->last_thread = this_thread;
    4343
    4444        yield( ((unsigned)rand48()) % 10 );
     
    5656        yield( ((unsigned)rand48()) % 10 );
    5757
    58         a->last_thread = b->last_thread = a->last_signaller = b->last_signaller = this_thread();
     58        a->last_thread = b->last_thread = a->last_signaller = b->last_signaller = this_thread;
    5959
    6060        if( !is_empty( &cond ) ) {
     
    8686//------------------------------------------------------------------------------
    8787void barge_op( global_data_t * mutex a ) {
    88         a->last_thread = this_thread();
     88        a->last_thread = this_thread;
    8989}
    9090
  • src/tests/sched-int-disjoint.c

    r55a68c3 r3d4b23fa  
    55
    66#ifndef N
    7 #define N 100_000
     7#define N 10_000
    88#endif
    99
     
    4242
    4343void main( Barger * this ) {
    44         while( !all_done ) { 
     44        while( !all_done ) {
    4545                barge( &data );
    46                 yield(); 
     46                yield();
    4747        }
    4848}
     
    5353        wait( &cond );
    5454        if( d->state != SIGNAL ) {
    55                 sout | "ERROR barging!" | endl; 
     55                sout | "ERROR barging!" | endl;
    5656        }
    5757
     
    8585        bool running = data.counter < N && data.counter > 0;
    8686        if( data.state != SIGNAL && running ) {
    87                 sout | "ERROR Eager signal" | data.state | endl; 
     87                sout | "ERROR Eager signal" | data.state | endl;
    8888        }
    8989}
     
    9292
    9393void main( Signaller * this ) {
    94         while( !all_done ) { 
     94        while( !all_done ) {
    9595                logic( &mut );
    96                 yield(); 
     96                yield();
    9797        }
    9898}
     
    111111                sout | "All waiter done" | endl;
    112112                all_done = true;
    113         }       
     113        }
    114114}
  • src/tests/sched-int-wait.c

    r55a68c3 r3d4b23fa  
    5050                unsigned action = (unsigned)rand48() % 4;
    5151                switch( action ) {
    52                         case 0: 
     52                        case 0:
    5353                                signal( &condABC, &globalA, &globalB, &globalC );
    5454                                break;
    55                         case 1: 
     55                        case 1:
    5656                                signal( &condAB , &globalA, &globalB );
    5757                                break;
    58                         case 2: 
     58                        case 2:
    5959                                signal( &condBC , &globalB, &globalC );
    6060                                break;
    61                         case 3: 
     61                        case 3:
    6262                                signal( &condAC , &globalA, &globalC );
    6363                                break;
     
    6767                }
    6868                yield();
    69         }       
     69        }
    7070}
    7171
  • src/tests/test.py

    r55a68c3 r3d4b23fa  
    166166
    167167        # build, skipping to next test on error
    168         make_ret, _ = sh("""%s test=yes EXTRA_FLAGS="%s" %s 2> %s 1> /dev/null""" % (make_cmd, options, test.name, out_file), dry_run)
     168        make_ret, _ = sh("""%s test=yes DEBUG_FLAGS="%s" %s 2> %s 1> /dev/null""" % (make_cmd, options, test.name, out_file), dry_run)
    169169
    170170        retcode = 0
     
    202202                        error = myfile.read()
    203203
    204                
     204
    205205        # clean the executable
    206206        sh("rm -f %s > /dev/null 2>&1" % test.name, dry_run)
  • src/tests/thread.c

    r55a68c3 r3d4b23fa  
    44#include <thread>
    55
    6 // thread First;
    7 // void main(First* this);
     6thread First  { semaphore* lock; };
     7thread Second { semaphore* lock; };
    88
    9 // thread Second;
    10 // void main(Second* this);
    11 
    12 thread First  { signal_once* lock; };
    13 thread Second { signal_once* lock; };
    14 
    15 void ?{}( First * this, signal_once* lock ) { this->lock = lock; }
    16 void ?{}( Second * this, signal_once* lock ) { this->lock = lock; }
     9void ?{}( First * this, semaphore* lock ) { this->lock = lock; }
     10void ?{}( Second * this, semaphore* lock ) { this->lock = lock; }
    1711
    1812void main(First* this) {
     
    2115                yield();
    2216        }
    23         signal(this->lock);
     17        V(this->lock);
    2418}
    2519
    2620void main(Second* this) {
    27         wait(this->lock);
     21        P(this->lock);
    2822        for(int i = 0; i < 10; i++) {
    2923                sout | "Second : Suspend No." | i + 1 | endl;
     
    3428
    3529int main(int argc, char* argv[]) {
    36         signal_once lock;
     30        semaphore lock = { 0 };
    3731        sout | "User main begin" | endl;
    3832        {
Note: See TracChangeset for help on using the changeset viewer.