mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Removed dependencies on pthread from frcsim.
Because we want to be able to compile/run wpilibC++Sim on windows, we would prefer not to require a windows version of pthread. This commit moves from pthread constructs to standard library constructs. Change-Id: I12392a8910189537dd067afdf017e4994d570a66
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
// Allows usage with std::unique_lock without including <mutex> separately
|
||||
#include <mutex>
|
||||
|
||||
#ifdef FRC_SIMULATOR
|
||||
// We do not want to use pthreads if in the simulator; however, in the
|
||||
// simulator, we do not care about priority inversion.
|
||||
typedef ::std::mutex priority_mutex;
|
||||
typedef ::std::recursive_mutex priority_recursive_mutex;
|
||||
#else // Covers rest of file.
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
class priority_recursive_mutex {
|
||||
public:
|
||||
typedef pthread_mutex_t *native_handle_type;
|
||||
@@ -65,3 +72,5 @@ class priority_mutex {
|
||||
{0, 0, 0, 0x20, 0, {0}}};
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // FRC_SIMULATOR
|
||||
|
||||
Reference in New Issue
Block a user