[libcxx] r238273 - Get thread sleep_for test passing in C++03
Eric Fiselier
eric at efcs.ca
Tue May 26 18:09:52 PDT 2015
Author: ericwf
Date: Tue May 26 20:09:51 2015
New Revision: 238273
URL: http://llvm.org/viewvc/llvm-project?rev=238273&view=rev
Log:
Get thread sleep_for test passing in C++03
Modified:
libcxx/trunk/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
Modified: libcxx/trunk/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp?rev=238273&r1=238272&r2=238273&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp Tue May 26 20:09:51 2015
@@ -17,14 +17,17 @@
#include <thread>
#include <cstdlib>
#include <cassert>
+#include <cstring>
#include <signal.h>
#include <sys/time.h>
+void sig_action(int) {}
+
int main()
{
int ec;
struct sigaction action;
- action.sa_handler = [](int) {};
+ action.sa_handler = &sig_action;
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
@@ -32,7 +35,7 @@ int main()
assert(!ec);
struct itimerval it;
- it.it_interval = { 0 };
+ std::memset(&it, 0, sizeof(itimerval));
it.it_value.tv_sec = 0;
it.it_value.tv_usec = 250000;
// This will result in a SIGALRM getting fired resulting in the nanosleep
More information about the cfe-commits
mailing list