#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
Threads::Thread<> t = Threads::new_thread(&test);
- sleep(2);
+ std::this_thread::sleep_for(std::chrono::seconds(2));
deallog << "1" << std::endl;
mutex.release();
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
void
test()
{
- sleep(3);
+ std::this_thread::sleep_for(std::chrono::seconds(3));
deallog << "OK" << std::endl;
}
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
int
test()
{
- sleep(3);
+ std::this_thread::sleep_for(std::chrono::seconds(3));
return 42;
}
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
test(int i)
{
deallog << "Task " << i << " starting..." << std::endl;
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
deallog << "Task " << i << " finished!" << std::endl;
}
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
t2.join();
}
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
deallog << "Task " << i << " finished!" << std::endl;
}
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
test(int i)
{
deallog << "Task " << i << " starting..." << std::endl;
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
if (i < 10)
{
Threads::new_task(test, 10 + i).join();
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
test(int i)
{
deallog << "Task " << i << " starting..." << std::endl;
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
deallog << "Task " << i << " finished!" << std::endl;
}
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
void
test(int i)
{
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
deallog << "Task " << i << " finished!" << std::endl;
}
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
void
test()
{
- sleep(3);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
deallog << "OK" << std::endl;
}
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
Threads::Mutex mutex;
// Sleep some time to make sure all other concurrently running tasks enter
// here.
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
mutex.acquire();
n_running--;
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
test(int i)
{
deallog << "Task " << i << " starting..." << std::endl;
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
deallog << "Task " << i << " finished!" << std::endl;
return 3.141;
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
test(int i)
{
deallog << "Task " << i << " starting..." << std::endl;
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
deallog << "Task " << i << " finished!" << std::endl;
return 3.141;
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
test(int i)
{
deallog << "Task " << i << " starting..." << std::endl;
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
deallog << "Task " << i << " finished!" << std::endl;
return 3.141;
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
test(int i)
{
deallog << "Task " << i << " starting..." << std::endl;
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
deallog << "Task " << i << " finished!" << std::endl;
return 3.141;
// wait in order to make sure that the
// thread lives longer than the TLS object
- sleep(5);
+ std::this_thread::sleep_for(std::chrono::seconds(5));
}
// wait in order to make sure that the
// thread lives longer than the TLS object
- sleep(5);
+ std::this_thread::sleep_for(std::chrono::seconds(5));
}
#include <deal.II/base/thread_local_storage.h>
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
}
// let threads work through their first part
- sleep(3);
+ std::this_thread::sleep_for(std::chrono::seconds(3));
// then reset the thread local object and release the mutices so the
// threads can actually run to an end
#include <deal.II/base/thread_local_storage.h>
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
}
// let threads work through their first part
- sleep(3);
+ std::this_thread::sleep_for(std::chrono::seconds(3));
// then reset the thread local object and release the mutices so the
// threads can actually run to an end
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
worker()
{
deallog << "Worker thread is starting." << std::endl;
- sleep(3);
+ std::this_thread::sleep_for(std::chrono::seconds(3));
deallog << "Worker thread is finished." << std::endl;
}
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include <atomic>
#include "../tests.h"
{
Threads::new_thread(worker);
}
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
// let abandoned thread continue
mutex.release();
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include <atomic>
#include "../tests.h"
{
Threads::new_thread(worker);
}
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
const unsigned int sz = 1000000;
char * p = new char[sz];
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
int
worker()
{
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
return 42;
}
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
#include <deal.II/base/thread_management.h>
-#include <unistd.h>
-
#include "../tests.h"
constraints.print(file);
}
MPI_Barrier(MPI_COMM_WORLD);
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
if (myid == 0)
{
// sort and merge the constraint matrices on proc 0, generate a checksum
constraints.print(file);
}
MPI_Barrier(MPI_COMM_WORLD);
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
if (myid == 0)
{
// sort and merge the constraint matrices on proc 0, generate a checksum
for (unsigned int i = 1; i < numprocs; ++i)
{
MPI_Barrier(MPI_COMM_WORLD);
- // system("sleep 1");
if (myid == 0)
{
MPI_Iprobe(0, 12345, MPI_COMM_WORLD, &flag, &status);
std::cout << flag << std::endl;
- sleep(1);
+ std::this_thread::sleep_for(std::chrono::seconds(1));
}
Assert(flag != 0, ExcMessage("hang in has_ghost_elements()"));