Skip to content

Commit 98b2b51

Browse files
committed
[wpiutil] Rename wpi::CreateSemaphore to wpi::MakeSemaphore
Signed-off-by: Jade Turner <[email protected]>
1 parent fa75636 commit 98b2b51

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

ntcoreffi/src/main/native/symbols.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ NT_WaitForListenerQueue
230230
WPI_AllocateString
231231
WPI_AllocateStringArray
232232
WPI_MakeEvent
233-
WPI_CreateSemaphore
233+
WPI_MakeSemaphore
234234
WPI_CreateSignalObject
235235
WPI_DataLog_AppendBoolean
236236
WPI_DataLog_AppendBooleanArray

wpiutil/src/main/native/cpp/Synchronization.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void wpi::ResetEvent(WPI_EventHandle handle) {
9292
ResetSignalObject(handle);
9393
}
9494

95-
WPI_SemaphoreHandle wpi::CreateSemaphore(int initialCount, int maximumCount) {
95+
WPI_SemaphoreHandle wpi::MakeSemaphore(int initialCount, int maximumCount) {
9696
auto& manager = GetManager();
9797
if (gShutdown) {
9898
return {};
@@ -341,8 +341,8 @@ void WPI_ResetEvent(WPI_EventHandle handle) {
341341
wpi::ResetEvent(handle);
342342
}
343343

344-
WPI_SemaphoreHandle WPI_CreateSemaphore(int initial_count, int maximum_count) {
345-
return wpi::CreateSemaphore(initial_count, maximum_count);
344+
WPI_SemaphoreHandle WPI_MakeSemaphore(int initial_count, int maximum_count) {
345+
return wpi::MakeSemaphore(initial_count, maximum_count);
346346
}
347347

348348
void WPI_DestroySemaphore(WPI_SemaphoreHandle handle) {

wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ JNIEXPORT jint JNICALL
217217
Java_edu_wpi_first_util_WPIUtilJNI_createSemaphore
218218
(JNIEnv*, jclass, jint initialCount, jint maximumCount)
219219
{
220-
return wpi::CreateSemaphore(initialCount, maximumCount);
220+
return wpi::MakeSemaphore(initialCount, maximumCount);
221221
}
222222

223223
/*

wpiutil/src/main/native/include/wpi/Synchronization.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void ResetEvent(WPI_EventHandle handle);
9393
* @param maximumCount maximum value for the semaphore's internal counter
9494
* @return Semaphore handle
9595
*/
96-
WPI_SemaphoreHandle CreateSemaphore(int initialCount = 0,
96+
WPI_SemaphoreHandle MakeSemaphore(int initialCount = 0,
9797
int maximumCount = INT_MAX);
9898

9999
/**
@@ -321,7 +321,7 @@ class Semaphore final {
321321
* @param maximumCount maximum value for the semaphore's internal counter
322322
*/
323323
explicit Semaphore(int initialCount = 0, int maximumCount = INT_MAX)
324-
: m_handle{CreateSemaphore(initialCount, maximumCount)} {}
324+
: m_handle{MakeSemaphore(initialCount, maximumCount)} {}
325325
~Semaphore() {
326326
if (m_handle != 0) {
327327
DestroySemaphore(m_handle);
@@ -494,7 +494,7 @@ void WPI_ResetEvent(WPI_EventHandle handle);
494494
* @param maximum_count maximum value for the semaphore's internal counter
495495
* @return Semaphore handle
496496
*/
497-
WPI_SemaphoreHandle WPI_CreateSemaphore(int initial_count, int maximum_count);
497+
WPI_SemaphoreHandle WPI_MakeSemaphore(int initial_count, int maximum_count);
498498

499499
/**
500500
* Destroys a semaphore. Destruction wakes up any waiters.

0 commit comments

Comments
 (0)