~mysql/mysql-server/mysql-6.0

« back to all changes in this revision

Viewing changes to mit-pthreads/tests/test_preemption.c

  • Committer: bk at mysql
  • Date: 2000-07-31 19:29:14 UTC
  • Revision ID: sp1r-bk@work.mysql.com-20000731192914-08846
Import changeset

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ==== test_pthread_cond.c =========================================
 
2
 * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
 
3
 *
 
4
 * Description : Test pthread_cond(). Run this after test_create()
 
5
 *
 
6
 *  1.23 94/05/04 proven
 
7
 *      -Started coding this file.
 
8
 */
 
9
 
 
10
#include <pthread.h>
 
11
#include <stdio.h>
 
12
 
 
13
void* new_thread(void * new_buf)
 
14
{
 
15
        int i;
 
16
 
 
17
        for (i = 0; i < 10; i++) {
 
18
                pthread_yield();
 
19
        }
 
20
        printf("test_preemption PASSED\n");
 
21
        exit(0);
 
22
}
 
23
 
 
24
main()
 
25
{
 
26
        pthread_t thread;
 
27
        int error;
 
28
 
 
29
        printf("test_preemption START\n");
 
30
 
 
31
        if (pthread_create(&thread, NULL, new_thread, NULL)) {
 
32
                printf("pthread_create failed\n");
 
33
                exit(2);
 
34
        }
 
35
 
 
36
        while(1);
 
37
        exit(1);
 
38
}