mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
merged from frcsim branch
verified to work on real robots adds sim eclipse plugins, fixed JavaGazebo, made wpilibC++Sim build on windows - Java and C++ simulation robot programs run on windows - simulation eclipse plugin delivers models and gazebo plugins - Java Gazebo now respects GAZEBO_IP variables and can work across networks - hal and network tables win32 hacked to work on windows - smart dashboard broken on windows due to network tables hacks - wpilibC++Sim, gz_msgs, and frcsim_gazebo_plugins build with CMake - removed constexpr for cross platform compatibility - msgs generated using .protos as a part of build process - some spare and unused cmake/pom files deleted - simulation ubuntu debians removed entirely - refactored CMake project flags and macros - updated to match non-sim C++ API - fixed and updated documentation - servo added to simulation Change-Id: Ia702ff0f1fee10d77f543810ad88f56696443b05
This commit is contained in:
@@ -10,31 +10,6 @@
|
||||
#define NT_CRITICAL_REGION(s) { NTSynchronized _sync(s);
|
||||
#define NT_END_REGION }
|
||||
|
||||
#if defined WIN32
|
||||
|
||||
#include <semLib.h>
|
||||
|
||||
class NTReentrantSemaphore
|
||||
{
|
||||
public:
|
||||
explicit NTReentrantSemaphore(){
|
||||
m_semaphore = semMCreate(SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE);
|
||||
};
|
||||
~NTReentrantSemaphore(){
|
||||
semDelete(m_semaphore);
|
||||
};
|
||||
void take(){
|
||||
semTake(m_semaphore, WAIT_FOREVER);
|
||||
};
|
||||
void give(){
|
||||
semGive(m_semaphore);
|
||||
};
|
||||
private:
|
||||
SEM_ID m_semaphore;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
class NTReentrantSemaphore
|
||||
@@ -59,7 +34,6 @@ private:
|
||||
pthread_mutexattr_t mta;
|
||||
pthread_mutex_t m_semaphore;
|
||||
};
|
||||
#endif // WIN32
|
||||
|
||||
/**
|
||||
* Provide easy support for critical regions.
|
||||
@@ -76,18 +50,9 @@ class NTSynchronized
|
||||
public:
|
||||
explicit NTSynchronized(NTReentrantSemaphore&);
|
||||
//TODO remove vxworks SEM_ID support
|
||||
#if defined WIN32
|
||||
explicit NTSynchronized(SEM_ID);
|
||||
#endif
|
||||
virtual ~NTSynchronized();
|
||||
private:
|
||||
#if defined WIN32
|
||||
bool usingSem;
|
||||
NTReentrantSemaphore* m_sem;
|
||||
SEM_ID m_semaphore;
|
||||
#else
|
||||
NTReentrantSemaphore& m_semaphore;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user