Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

Commit d68bb2a

Browse files
liam-tealeion098
andauthored
remove unused helper functions
Co-authored-by: ion098 <146852218+ion098@users.noreply.github.com>
1 parent 0c9e913 commit d68bb2a

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

src/system/system_daemon.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,6 @@ void vexTasksRun();
2525
void ser_output_flush();
2626
}
2727

28-
/**
29-
* @brief lock a sequence of smart ports
30-
*
31-
* For whatever reason, std::lock only compiles if you pass the mutexes like this:
32-
* std::lock(mutex_a, mutex_b, mutex_c);
33-
* You can't pass it an array or iterator or lambda, so we have to use this helper function instead.
34-
*/
35-
template<std::size_t... Is>
36-
static void lock_ports(std::index_sequence<Is...>) {
37-
// std::lock locks multiple mutexes without risk of a deadlock
38-
std::lock(zest::Brain::ports[Is].mutex...);
39-
}
40-
41-
/**
42-
* @brief unlock a sequence of smart ports
43-
*
44-
* For whatever reason, std::unlock only compiles if you pass the mutexes like this:
45-
* std::unlock(mutex_a, mutex_b, mutex_c);
46-
* You can't pass it an array or iterator or lambda, so we have to use this helper function instead
47-
*/
48-
template<std::size_t... Is>
49-
static void unlock_ports(std::index_sequence<Is...>) {
50-
constexpr std::size_t N = sizeof...(Is);
51-
// Unlock in reverse order (RAII best practice)
52-
(zest::Brain::ports[N - 1 - Is].mutex.unlock(), ...);
53-
}
5428

5529
/**
5630
* @brief lock all smart port mutexes

0 commit comments

Comments
 (0)