mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
[artf3749] Repaired undefined behavior in takeMultiWait.
Change-Id: Ieae7d602472f585db2a896cc76355a5c23d1d670
This commit is contained in:
@@ -45,6 +45,7 @@ DriverStation::DriverStation()
|
||||
{
|
||||
// Create a new semaphore
|
||||
m_waitForDataSem = initializeMultiWait();
|
||||
m_waitForDataMutex = initializeMutexNormal();
|
||||
m_stateSemaphore = initializeMutexRecursive();
|
||||
m_joystickSemaphore = initializeMutexRecursive();
|
||||
|
||||
@@ -78,6 +79,7 @@ DriverStation::~DriverStation()
|
||||
{
|
||||
m_instance = NULL;
|
||||
deleteMultiWait(m_waitForDataSem);
|
||||
deleteMutex(m_waitForDataMutex);
|
||||
// TODO: Release m_stateSemaphore and m_joystickSemaphore?
|
||||
}
|
||||
|
||||
@@ -311,7 +313,7 @@ uint32_t DriverStation::GetLocation()
|
||||
*/
|
||||
void DriverStation::WaitForData()
|
||||
{
|
||||
takeMultiWait(m_waitForDataSem, SEMAPHORE_WAIT_FOREVER);
|
||||
takeMultiWait(m_waitForDataSem, m_waitForDataMutex, SEMAPHORE_WAIT_FOREVER);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user