mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Make wpi::condition_variable typedef to std::condition_variable_any if wpi::mutex typedefs to priority_mutex. priority_condition_variable was originally intended as a copy of std::condition_variable_any that also returned the internal handle like std::condition_variable. This was needed because NetComm required a pthread_cond_t. We no longer use it anywhere. Its args were specialized for priority_mutex, but std::condition_variable_any supports this and more through templatization.
23 lines
787 B
C++
23 lines
787 B
C++
/*----------------------------------------------------------------------------*/
|
|
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
/* the project. */
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
#pragma once
|
|
|
|
#include <condition_variable>
|
|
|
|
#include "wpi/priority_mutex.h"
|
|
|
|
namespace wpi {
|
|
|
|
#if defined(__linux__) && defined(WPI_HAVE_PRIORITY_MUTEX)
|
|
using condition_variable = ::std::condition_variable_any;
|
|
#else
|
|
using condition_variable = ::std::condition_variable;
|
|
#endif
|
|
|
|
} // namespace wpi
|