testsuite_hooks.cc: Update coypright and follow style guidelines.
* testsuite/testsuite_hooks.cc: Update coypright and follow style guidelines. * testsuite/testsuite_hooks.h: Likewise. * testsuite/27_io/basic_filebuf/close/char/4879.cc: Use semaphores, not sleep. * testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise. * testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc: Likewise. * testsuite/27_io/basic_filebuf/imbue/char/13582-2.cc: Likewise. * testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise. * testsuite/27_io/basic_filebuf/underflow/char/10097.cc: Likewise. * testsuite/27_io/objects/char/7.cc: Likewise. * testsuite/27_io/objects/char/9661-1.cc: Likewise. * testsuite/27_io/objects/wchar_t/7.cc: Likewise. * testsuite/27_io/objects/wchar_t/9661-1.cc: Likewise. From-SVN: r92877
This commit is contained in:
parent
85b7d88973
commit
8ca82e0965
14 changed files with 45 additions and 31 deletions
|
@ -1,5 +1,22 @@
|
|||
2005-01-03 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* testsuite/testsuite_hooks.cc: Update coypright and follow style
|
||||
guidelines.
|
||||
* testsuite/testsuite_hooks.h: Likewise.
|
||||
* testsuite/27_io/basic_filebuf/close/char/4879.cc: Use
|
||||
semaphores, not sleep.
|
||||
* testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise.
|
||||
* testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc: Likewise.
|
||||
* testsuite/27_io/basic_filebuf/imbue/char/13582-2.cc: Likewise.
|
||||
* testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc:
|
||||
Likewise.
|
||||
* testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise.
|
||||
* testsuite/27_io/basic_filebuf/underflow/char/10097.cc: Likewise.
|
||||
* testsuite/27_io/objects/char/7.cc: Likewise.
|
||||
* testsuite/27_io/objects/char/9661-1.cc: Likewise.
|
||||
* testsuite/27_io/objects/wchar_t/7.cc: Likewise.
|
||||
* testsuite/27_io/objects/wchar_t/9661-1.cc: Likewise.
|
||||
|
||||
* configure.ac: Check for sys/ipc.h and sys/sem.h.
|
||||
* config.h.in: Regenerated.
|
||||
* configure: Likewise.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2004-01-11 Petur Runolfsson <peturr02@ru.is>
|
||||
|
||||
// Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2004-04-16 Petur Runolfsson <peturr02@ru.is>
|
||||
|
||||
// Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2003-04-26 Petur Runolfsson <peturr02@ru.is>
|
||||
|
||||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2003-04-30 Petur Runolfsson <peturr02@ru.is>
|
||||
|
||||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2003-05-01 Petur Runolfsson <peturr02@ru.is>
|
||||
|
||||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2003-04-30 Petur Runolfsson <peturr02@ru.is>
|
||||
|
||||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// -*- C++ -*-
|
||||
// Utility subroutines for the C++ library testsuite.
|
||||
//
|
||||
// Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -278,8 +278,7 @@ namespace __gnu_test
|
|||
};
|
||||
#endif
|
||||
|
||||
semaphore::semaphore ()
|
||||
{
|
||||
semaphore::semaphore() {
|
||||
#ifdef _GLIBCXX_SYSV_SEM
|
||||
// Remeber the PID for the process that created the semaphore set
|
||||
// so that only one process will destroy the set.
|
||||
|
@ -295,42 +294,40 @@ namespace __gnu_test
|
|||
#endif
|
||||
|
||||
// Get a semaphore set with one semaphore.
|
||||
sem_set_ = semget (IPC_PRIVATE, 1, SEM_R | SEM_A);
|
||||
sem_set_ = semget(IPC_PRIVATE, 1, SEM_R | SEM_A);
|
||||
if (sem_set_ == -1)
|
||||
throw std::runtime_error ("could not obtain semaphore set");
|
||||
|
||||
// Initialize the semaphore.
|
||||
union semun val;
|
||||
val.val = 0;
|
||||
if (semctl (sem_set_, 0, SETVAL, val) == -1)
|
||||
throw std::runtime_error ("could not initialize semaphore");
|
||||
if (semctl(sem_set_, 0, SETVAL, val) == -1)
|
||||
throw std::runtime_error("could not initialize semaphore");
|
||||
#else
|
||||
// There are no semaphores on this system. We have no way to mark
|
||||
// a test as "unsupported" at runtime, so we just exit, pretending
|
||||
// that the test passed.
|
||||
exit (0);
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
semaphore::~semaphore ()
|
||||
{
|
||||
semaphore::~semaphore() {
|
||||
#ifdef _GLIBCXX_SYSV_SEM
|
||||
union semun val;
|
||||
// Destroy the semaphore set only in the process that created it.
|
||||
if (pid_ == getpid ())
|
||||
semctl (sem_set_, 0, IPC_RMID, val);
|
||||
if (pid_ == getpid())
|
||||
semctl(sem_set_, 0, IPC_RMID, val);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
semaphore::signal ()
|
||||
{
|
||||
semaphore::signal() {
|
||||
#ifdef _GLIBCXX_SYSV_SEM
|
||||
struct sembuf op[1] = {
|
||||
{ 0, 1, 0 }
|
||||
};
|
||||
if (semop (sem_set_, op, 1) == -1)
|
||||
throw std::runtime_error ("could not signal semaphore");
|
||||
if (semop(sem_set_, op, 1) == -1)
|
||||
throw std::runtime_error("could not signal semaphore");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -340,8 +337,8 @@ namespace __gnu_test
|
|||
struct sembuf op[1] = {
|
||||
{ 0, -1, SEM_UNDO }
|
||||
};
|
||||
if (semop (sem_set_, op, 1) == -1)
|
||||
throw std::runtime_error ("could not wait for semaphore");
|
||||
if (semop(sem_set_, op, 1) == -1)
|
||||
throw std::runtime_error("could not wait for semaphore");
|
||||
#endif
|
||||
}
|
||||
}; // namespace __gnu_test
|
||||
|
|
|
@ -387,17 +387,17 @@ namespace __gnu_test
|
|||
public:
|
||||
// Creates a binary semaphore. The semaphore is initially in the
|
||||
// unsignaled state.
|
||||
semaphore ();
|
||||
semaphore();
|
||||
|
||||
// Destroy the semaphore.
|
||||
~semaphore();
|
||||
|
||||
// Signal the semaphore. If there are processes blocked in
|
||||
// "wait", exactly one will be permitted to proceed.
|
||||
void signal ();
|
||||
void signal();
|
||||
|
||||
// Wait until the semaphore is signaled.
|
||||
void wait ();
|
||||
void wait();
|
||||
|
||||
private:
|
||||
int sem_set_;
|
||||
|
|
Loading…
Add table
Reference in a new issue