5e0c55140a
From MAINTAINER Benoit Chesneau (benoitc at metavers dot net), Thanks !! With tweaks and testing from ian@, simon@ and myself. ok ian@ sthen@
38 lines
847 B
Plaintext
38 lines
847 B
Plaintext
$OpenBSD: patch-src_dom_util_thread_cpp,v 1.1.1.1 2008/04/04 14:37:26 landry Exp $
|
|
--- src/dom/util/thread.cpp.orig Fri Mar 28 16:19:08 2008
|
|
+++ src/dom/util/thread.cpp Fri Mar 28 16:20:56 2008
|
|
@@ -33,6 +33,10 @@
|
|
*
|
|
*/
|
|
|
|
+#if defined(__OpenBSD__)
|
|
+#include <pthread.h>
|
|
+#endif
|
|
+
|
|
#include "thread.h"
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
@@ -77,7 +81,9 @@ void Thread::sleep(unsigned long millis)
|
|
|
|
|
|
#else /* UNIX */
|
|
+#if !defined(__OpenBSD__)
|
|
#include <pthread.h>
|
|
+#endif
|
|
|
|
void *PthreadThreadFunction(void *context)
|
|
{
|
|
@@ -104,7 +110,12 @@ void Thread::start()
|
|
|
|
void Thread::sleep(unsigned long millis)
|
|
{
|
|
+#if defined(__OpenBSD__)
|
|
+ struct timespec requested;
|
|
+#else
|
|
timespec requested;
|
|
+#endif
|
|
+
|
|
requested.tv_sec = millis / 1000;
|
|
requested.tv_nsec = (millis % 1000 ) * 1000000L;
|
|
nanosleep(&requested, NULL);
|