mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
artf4149: Removed references to VxWorks
Implemented setTaskPriority() and getTaskPriority() in Task HAL API Removed all other unimplemented functions in HAL and removed spawnTask() Replaced instances of pthread_t* with TASK typedef Removed unused HAL error constants and removed commented-out classes and functions in wpilibj's HALLibrary Changed Task class API to match the construction semantics of a std::thread Change-Id: I3bc951a3da90d24c5589fae4d1ca2bb60225c873
This commit is contained in:
committed by
James Kuszmaul
parent
5712565068
commit
fd4c169658
@@ -7,11 +7,8 @@
|
||||
#ifndef _ERROR_BASE_H
|
||||
#define _ERROR_BASE_H
|
||||
|
||||
#if (defined __vxworks || defined WIN32)
|
||||
#if defined WIN32
|
||||
#include <semLib.h>
|
||||
#ifdef __vxworks
|
||||
#include <vxWorks.h>
|
||||
#endif
|
||||
|
||||
#define DISALLOW_COPY_AND_ASSIGN(ErrorBase)
|
||||
|
||||
@@ -44,4 +41,4 @@ public:
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // __vxworks
|
||||
#endif // WIN32
|
||||
|
||||
@@ -10,11 +10,8 @@
|
||||
#define NT_CRITICAL_REGION(s) { NTSynchronized _sync(s);
|
||||
#define NT_END_REGION }
|
||||
|
||||
#if (defined __vxworks || defined WIN32)
|
||||
#if defined WIN32
|
||||
|
||||
#ifdef __vxworks
|
||||
#include <vxWorks.h>
|
||||
#endif
|
||||
#include <semLib.h>
|
||||
|
||||
class NTReentrantSemaphore
|
||||
@@ -62,7 +59,7 @@ private:
|
||||
pthread_mutexattr_t mta;
|
||||
pthread_mutex_t m_semaphore;
|
||||
};
|
||||
#endif // __vxworks
|
||||
#endif // WIN32
|
||||
|
||||
/**
|
||||
* Provide easy support for critical regions.
|
||||
@@ -79,12 +76,12 @@ class NTSynchronized
|
||||
public:
|
||||
explicit NTSynchronized(NTReentrantSemaphore&);
|
||||
//TODO remove vxworks SEM_ID support
|
||||
#if (defined __vxworks || defined WIN32)
|
||||
#if defined WIN32
|
||||
explicit NTSynchronized(SEM_ID);
|
||||
#endif
|
||||
virtual ~NTSynchronized();
|
||||
private:
|
||||
#if (defined __vxworks || defined WIN32)
|
||||
#if defined WIN32
|
||||
bool usingSem;
|
||||
NTReentrantSemaphore* m_sem;
|
||||
SEM_ID m_semaphore;
|
||||
|
||||
@@ -7,12 +7,9 @@
|
||||
#ifndef __NTTASK_H__
|
||||
#define __NTTASK_H__
|
||||
|
||||
#if (defined __vxworks || defined WIN32)
|
||||
#if defined WIN32
|
||||
|
||||
#include "NTErrorBase.h"
|
||||
#ifdef __vxworks
|
||||
#include <vxWorks.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* WPI task is a wrapper for the native Task object.
|
||||
@@ -72,5 +69,5 @@ private:
|
||||
DISALLOW_COPY_AND_ASSIGN(NTTask);
|
||||
};
|
||||
|
||||
#endif // __vxworks
|
||||
#endif // WIN32
|
||||
#endif // __TASK_H__
|
||||
|
||||
@@ -17,7 +17,7 @@ class PeriodicNTThread;
|
||||
#include "networktables2/thread/NTThreadManager.h"
|
||||
#include "networktables2/thread/NTThread.h"
|
||||
|
||||
#if (defined __vxworks || defined WIN32)
|
||||
#if defined WIN32
|
||||
#include "OSAL/Task.h"
|
||||
#else
|
||||
#include <pthread.h>
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
|
||||
class PeriodicNTThread : public NTThread {
|
||||
private:
|
||||
#if (defined __vxworks || defined WIN32)
|
||||
#if defined WIN32
|
||||
const char* name;
|
||||
NTTask* thread;
|
||||
#else
|
||||
@@ -38,7 +38,7 @@ private:
|
||||
#endif
|
||||
PeriodicRunnable* r;
|
||||
bool run;
|
||||
#if (defined __vxworks || defined WIN32)
|
||||
#if defined WIN32
|
||||
int _taskMain();
|
||||
static int taskMain(PeriodicNTThread* o);
|
||||
#else//TODO make return int for pthread as well
|
||||
|
||||
Reference in New Issue
Block a user