Ignore:
Timestamp:
Aug 27, 2018, 4:40:34 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b7c89aa
Parents:
f9feab8 (diff), 305581d (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' into cleanup-dtors

File:
1 moved

Legend:

Unmodified
Added
Removed
  • tests/concurrent/signal/wait.c

    rf9feab8 r90152a4  
    55
    66
    7 #include <fstream>
    8 #include <kernel>
    9 #include <monitor>
    10 #include <stdlib>
    11 #include <thread>
     7#include <fstream.hfa>
     8#include <kernel.hfa>hfa>
     9#include <monitor.hfa>
     10#include <stdlib.hfa>
     11#include <thread.hfa>
     12#include <time.hfa>
    1213
    13 #include <time.h>
    14 
    15 static const unsigned long N = 2_500ul;
     14#define __kick_rate 12000ul
     15#include "long_tests.h"
    1616
    1717#ifndef PREEMPTION_RATE
    18 #define PREEMPTION_RATE 10_000ul
     18#define PREEMPTION_RATE 10`ms
    1919#endif
    2020
    21 unsigned int default_preemption() {
     21Duration default_preemption() {
    2222        return PREEMPTION_RATE;
    2323}
     24
     25#ifdef TEST_LONG
     26static const unsigned long N = 375_000ul;
     27#else
     28static const unsigned long N = 2_500ul;
     29#endif
    2430
    2531monitor global_t {};
     
    8793// Waiter ABC
    8894void main( WaiterABC & this ) {
    89         for( int i = 0; i < N; i++ ) {
     95        for( int i = 0; TEST(i < N); i++ ) {
    9096                wait( condABC, globalA, globalB, globalC );
     97                KICK_WATCHDOG;
    9198        }
    9299
     
    97104// Waiter AB
    98105void main( WaiterAB & this ) {
    99         for( int i = 0; i < N; i++ ) {
     106        for( int i = 0; TEST(i < N); i++ ) {
    100107                wait( condAB , globalA, globalB );
     108                KICK_WATCHDOG;
    101109        }
    102110
     
    107115// Waiter AC
    108116void main( WaiterAC & this ) {
    109         for( int i = 0; i < N; i++ ) {
     117        for( int i = 0; TEST(i < N); i++ ) {
    110118                wait( condAC , globalA, globalC );
     119                KICK_WATCHDOG;
    111120        }
    112121
     
    117126// Waiter BC
    118127void main( WaiterBC & this ) {
    119         for( int i = 0; i < N; i++ ) {
     128        for( int i = 0; TEST(i < N); i++ ) {
    120129                wait( condBC , globalB, globalC );
     130                KICK_WATCHDOG;
    121131        }
    122132
     
    127137// Main
    128138int main(int argc, char* argv[]) {
    129         random_seed( time( NULL ) );
     139        srandom( time( NULL ) );
    130140        waiter_left = 4;
    131141        processor p[2];
Note: See TracChangeset for help on using the changeset viewer.