Ignore:
Timestamp:
Nov 2, 2017, 3:48:22 PM (6 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:
bbeb908
Parents:
64b272a (diff), 0dc954b (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:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/prodcons.c

    r64b272a re706bfd  
    1010// Created On       : Mon Sep 18 12:23:39 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Sep 20 17:03:28 2017
    13 // Update Count     : 40
     12// Last Modified On : Mon Oct 30 23:06:05 2017
     13// Update Count     : 42
    1414//
    1515
    1616#include <fstream>
    1717#include <coroutine>
    18 #include <stdlib>                                                                               // rand48
     18#include <stdlib>                                                                               // random
    1919#include <unistd.h>                                                                             // getpid
    2020
     
    3030        // 1st resume starts here
    3131        for ( int i = 0; i < prod.N; i += 1 ) {
    32                 int p1 = (unsigned int)rand48() % 100;                  // non-negative
    33                 int p2 = (unsigned int)rand48() % 100;
     32                int p1 = random( 100 );
     33                int p2 = random( 100 );
    3434                sout | p1 | " " | p2 | endl;
    3535                int status = delivery( *prod.c, p1, p2 );
     
    9090        Prod prod;
    9191        Cons cons = { prod };
    92         rand48seed( /* getpid() */ 103 );                                       // fixed seed for testing
     92        random_seed( /* getpid() */ 103 );                                      // fixed seed for testing
    9393        start( prod, 5, cons );
    9494        sout | "main stops" | endl;
Note: See TracChangeset for help on using the changeset viewer.