Replaced obsolete __linux usage.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <pthread.h>
|
||||
#include <limits.h>
|
||||
|
||||
#if defined __linux || defined __sun || defined __APPLE__ || ANDROID
|
||||
#if defined __linux__ || defined __sun || defined __APPLE__ || ANDROID
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
@@ -459,7 +459,7 @@ Thread::~Thread()
|
||||
}
|
||||
|
||||
delete pd;
|
||||
|
||||
|
||||
_prvData = 0;
|
||||
}
|
||||
|
||||
@@ -573,7 +573,7 @@ int Thread::setProcessorAffinity(unsigned int cpunum)
|
||||
PThreadPrivateData *pd = static_cast<PThreadPrivateData *> (_prvData);
|
||||
pd->cpunum = cpunum;
|
||||
if (pd->cpunum<0) return -1;
|
||||
|
||||
|
||||
#ifdef __sgi
|
||||
|
||||
int status;
|
||||
@@ -715,7 +715,7 @@ int Thread::start() {
|
||||
//
|
||||
int Thread::startThread()
|
||||
{
|
||||
if (_prvData) return start();
|
||||
if (_prvData) return start();
|
||||
else return 0;
|
||||
}
|
||||
|
||||
@@ -1032,7 +1032,7 @@ int OpenThreads::GetNumberOfProcessors()
|
||||
uint64_t num_cpus = 0;
|
||||
size_t num_cpus_length = sizeof(num_cpus);
|
||||
#if defined(__FreeBSD__)
|
||||
sysctlbyname("hw.ncpu", &num_cpus, &num_cpus_length, NULL, 0);
|
||||
sysctlbyname("hw.ncpu", &num_cpus, &num_cpus_length, NULL, 0);
|
||||
#else
|
||||
sysctlbyname("hw.activecpu", &num_cpus, &num_cpus_length, NULL, 0);
|
||||
#endif
|
||||
@@ -1047,7 +1047,7 @@ int OpenThreads::SetProcessorAffinityOfCurrentThread(unsigned int cpunum)
|
||||
Thread::Init();
|
||||
|
||||
Thread* thread = Thread::CurrentThread();
|
||||
if (thread)
|
||||
if (thread)
|
||||
{
|
||||
return thread->setProcessorAffinity(cpunum);
|
||||
}
|
||||
@@ -1069,6 +1069,6 @@ int OpenThreads::SetProcessorAffinityOfCurrentThread(unsigned int cpunum)
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user