Code style fixes for FreeBSD support pull request.
This commit is contained in:
parent
9c0fe73102
commit
10df3ec227
3 changed files with 18 additions and 16 deletions
|
@ -20,12 +20,16 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/cpuset.h>
|
||||
#include <pthread_np.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/param.h>
|
||||
# include <sys/cpuset.h>
|
||||
# include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
#include <unistd.h>
|
||||
|
@ -34,10 +38,12 @@
|
|||
|
||||
#include "Cpu.h"
|
||||
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
typedef cpuset_t cpu_set_t;
|
||||
#endif
|
||||
|
||||
|
||||
void Cpu::init()
|
||||
{
|
||||
# ifdef XMRIG_NO_LIBCPUID
|
||||
|
@ -60,9 +66,9 @@ void Cpu::setAffinity(int id, uint64_t mask)
|
|||
}
|
||||
|
||||
if (id == -1) {
|
||||
#ifndef __FreeBSD__
|
||||
# ifndef __FreeBSD__
|
||||
sched_setaffinity(0, sizeof(&set), &set);
|
||||
#endif
|
||||
# endif
|
||||
} else {
|
||||
pthread_setaffinity_np(pthread_self(), sizeof(&set), &set);
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ void Platform::setThreadPriority(int priority)
|
|||
|
||||
setpriority(PRIO_PROCESS, 0, prio);
|
||||
|
||||
#ifdef SCHED_IDLE
|
||||
# ifdef SCHED_IDLE
|
||||
if (priority == 0) {
|
||||
sched_param param;
|
||||
param.sched_priority = 0;
|
||||
|
@ -124,5 +124,5 @@ void Platform::setThreadPriority(int priority)
|
|||
sched_setscheduler(0, SCHED_BATCH, ¶m);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue