Changeset View
Changeset View
Standalone View
Standalone View
graphics/osgearth/files/patch-src_osgEarth_ThreadingUtils.cpp
- This file was moved from graphics/osgearth/files/patch-src-osgEarth-ThreadingUtils.cpp.
--- src/osgEarth/ThreadingUtils.cpp.orig 2013-05-16 20:29:30.000000000 +0200 | --- src/osgEarth/ThreadingUtils.cpp.orig 2016-02-10 18:21:28 UTC | ||||
+++ src/osgEarth/ThreadingUtils.cpp 2013-05-16 20:28:01.000000000 +0200 | +++ src/osgEarth/ThreadingUtils.cpp | ||||
@@ -23,6 +23,7 @@ | @@ -23,6 +23,7 @@ | ||||
#else | #else | ||||
# include <unistd.h> | # include <unistd.h> | ||||
# include <sys/syscall.h> | # include <sys/syscall.h> | ||||
+# include <sys/thr.h> | +# include <sys/thr.h> | ||||
#endif | #endif | ||||
using namespace osgEarth::Threading; | using namespace osgEarth::Threading; | ||||
@@ -38,6 +39,10 @@ | @@ -40,6 +41,10 @@ unsigned osgEarth::Threading::getCurrent | ||||
return (unsigned)::GetCurrentThreadId(); | |||||
#elif __APPLE__ | |||||
return ::syscall(SYS_thread_selfid); | return ::syscall(SYS_thread_selfid); | ||||
#elif __ANDROID__ | |||||
return gettid(); | |||||
+#elif __FreeBSD__ | +#elif __FreeBSD__ | ||||
+ long lwpid; | + long lwpid; | ||||
+ thr_self(&lwpid); | + thr_self(&lwpid); | ||||
+ return lwpid; | + return lwpid; | ||||
#else | #else | ||||
return (unsigned)::syscall(SYS_gettid); | return (unsigned)::syscall(SYS_gettid); | ||||
#endif | #endif |