~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to gnulib-tests/test-lock.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- buffer-read-only: t -*- vi: set ro: */
2
 
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3
1
/* Test of locking in multithreaded situations.
4
 
   Copyright (C) 2005, 2008-2011 Free Software Foundation, Inc.
 
2
   Copyright (C) 2005, 2008-2012 Free Software Foundation, Inc.
5
3
 
6
4
   This program is free software: you can redistribute it and/or modify
7
5
   it under the terms of the GNU General Public License as published by
20
18
 
21
19
#include <config.h>
22
20
 
23
 
#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WIN32_THREADS
 
21
#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS
24
22
 
25
23
#if USE_POSIX_THREADS
26
24
# define TEST_POSIX_THREADS 1
31
29
#if USE_PTH_THREADS
32
30
# define TEST_PTH_THREADS 1
33
31
#endif
34
 
#if USE_WIN32_THREADS
35
 
# define TEST_WIN32_THREADS 1
 
32
#if USE_WINDOWS_THREADS
 
33
# define TEST_WINDOWS_THREADS 1
36
34
#endif
37
35
 
38
36
/* Whether to enable locking.
71
69
# undef USE_POSIX_THREADS
72
70
# undef USE_SOLARIS_THREADS
73
71
# undef USE_PTH_THREADS
74
 
# undef USE_WIN32_THREADS
 
72
# undef USE_WINDOWS_THREADS
75
73
#endif
76
74
#include "glthread/lock.h"
77
75
 
85
83
# if TEST_PTH_THREADS
86
84
#  define USE_PTH_THREADS 1
87
85
# endif
88
 
# if TEST_WIN32_THREADS
89
 
#  define USE_WIN32_THREADS 1
 
86
# if TEST_WINDOWS_THREADS
 
87
#  define USE_WINDOWS_THREADS 1
90
88
# endif
91
89
#endif
92
90
 
497
495
  for (repeat = 0; repeat <= REPEAT_COUNT; repeat++)
498
496
    {
499
497
      /* Wait until every thread is ready.  */
500
 
      dbgprintf ("Main thread before synchonizing for round %d\n", repeat);
 
498
      dbgprintf ("Main thread before synchronizing for round %d\n", repeat);
501
499
      for (;;)
502
500
        {
503
501
          int ready_count = 0;
511
509
            break;
512
510
          yield ();
513
511
        }
514
 
      dbgprintf ("Main thread after  synchonizing for round %d\n", repeat);
 
512
      dbgprintf ("Main thread after  synchronizing for round %d\n", repeat);
515
513
 
516
514
      if (repeat > 0)
517
515
        {