summaryrefslogtreecommitdiff
path: root/test/pthread
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2009-11-28 22:00:53 -0800
committerAustin Foxley <austinf@cetoncorp.com>2009-11-28 22:40:05 -0800
commit8359f22a288236613e64f2b3e96ef6e2ac2de097 (patch)
tree04967bfdadf913d1f8a70ddf5769446d963546dd /test/pthread
parent5418ef694ee17c698270702d927f04836706e60b (diff)
parent8739ed0a9b6597e7106f878ec159a19fe0848f23 (diff)
Merge remote branch 'origin/master' into nptl
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'test/pthread')
-rw-r--r--test/pthread/cancellation-points.c4
-rw-r--r--test/pthread/ex6.c7
-rw-r--r--test/pthread/ex7.c7
3 files changed, 14 insertions, 4 deletions
diff --git a/test/pthread/cancellation-points.c b/test/pthread/cancellation-points.c
index 3fe49fcaa..af5df3aa1 100644
--- a/test/pthread/cancellation-points.c
+++ b/test/pthread/cancellation-points.c
@@ -149,7 +149,9 @@ MAKE_CANCEL_THREAD_FUNC(sigwaitinfo, (NULL, NULL))
MAKE_CANCEL_THREAD_FUNC(sleep, (0))
MAKE_CANCEL_THREAD_FUNC(system, (""))
MAKE_CANCEL_THREAD_FUNC(tcdrain, (-1))
+#ifdef __UCLIBC_SUSV3_LEGACY__
MAKE_CANCEL_THREAD_FUNC(usleep, (0))
+#endif
MAKE_CANCEL_THREAD_FUNC(wait, (NULL))
MAKE_CANCEL_THREAD_FUNC(waitid, (0, 0, NULL, 0))
MAKE_CANCEL_THREAD_FUNC(waitpid, (-1, NULL, 0))
@@ -264,7 +266,9 @@ int main(int argc, char *argv[])
ret += TEST_FUNC(sleep);
ret += TEST_FUNC(system);
ret += TEST_FUNC(tcdrain);
+#ifdef __UCLIBC_SUSV3_LEGACY__
ret += TEST_FUNC(usleep);
+#endif
ret += TEST_FUNC(wait);
ret += TEST_FUNC(waitid);
ret += TEST_FUNC(waitpid);
diff --git a/test/pthread/ex6.c b/test/pthread/ex6.c
index bb96ca5fa..ffb628771 100644
--- a/test/pthread/ex6.c
+++ b/test/pthread/ex6.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <pthread.h>
-#include <unistd.h>
+#include <time.h>
static void *
test_thread (void *v_param)
@@ -14,6 +14,9 @@ int
main (void)
{
unsigned long count;
+ struct timespec ts;
+ ts.tv_sec = 0;
+ ts.tv_nsec = 10 * 1000;
setvbuf (stdout, NULL, _IONBF, 0);
@@ -35,7 +38,7 @@ main (void)
}
/* pthread_detach (thread); */
pthread_join (thread, NULL);
- usleep (10);
+ nanosleep (&ts, NULL);
}
return 0;
}
diff --git a/test/pthread/ex7.c b/test/pthread/ex7.c
index 49af18d96..8eeb9a2e5 100644
--- a/test/pthread/ex7.c
+++ b/test/pthread/ex7.c
@@ -8,7 +8,7 @@
#include <string.h>
#include <pthread.h>
#include <sys/time.h>
-#include <unistd.h>
+#include <time.h>
/* Our event variable using a condition variable contruct. */
typedef struct {
@@ -63,6 +63,9 @@ int
main (void)
{
unsigned long count;
+ struct timespec ts;
+ ts.tv_sec = 0;
+ ts.tv_nsec = 10 * 1000;
setvbuf (stdout, NULL, _IONBF, 0);
@@ -96,7 +99,7 @@ main (void)
printf ("count = %lu\n", count);
}
- usleep (10);
+ nanosleep (&ts, NULL);
}
return 0;