Skip to content

Commit 87e8580

Browse files
committed
Unify waitDeleteFunc, decrementDeleteFunc.
1 parent 744b28c commit 87e8580

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

include/opdi/logic/omp/mutexOmpLogic.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ void opdi::MutexOmpLogic::waitReverseFunc(void* dataPtr) {
7373
#endif
7474
}
7575

76-
void opdi::MutexOmpLogic::waitDeleteFunc(void* dataPtr) {
77-
Data* data = static_cast<Data*>(dataPtr);
78-
delete data;
79-
}
80-
8176
void opdi::MutexOmpLogic::decrementReverseFunc(void* dataPtr) {
8277

8378
Data* data = static_cast<Data*>(dataPtr);
@@ -97,7 +92,7 @@ void opdi::MutexOmpLogic::decrementReverseFunc(void* dataPtr) {
9792
#endif
9893
}
9994

100-
void opdi::MutexOmpLogic::decrementDeleteFunc(void* dataPtr) {
95+
void opdi::MutexOmpLogic::deleteFunc(void* dataPtr) {
10196
Data* data = static_cast<Data*>(dataPtr);
10297
delete data;
10398
}
@@ -165,7 +160,7 @@ void opdi::MutexOmpLogic::onMutexAcquired(MutexKind mutexKind, WaitId waitId) {
165160
Handle* handle = new Handle;
166161
handle->data = static_cast<void*>(data);
167162
handle->reverseFunc = MutexOmpLogic::decrementReverseFunc;
168-
handle->deleteFunc = MutexOmpLogic::decrementDeleteFunc;
163+
handle->deleteFunc = MutexOmpLogic::deleteFunc;
169164

170165
tool->pushExternalFunction(tool->getThreadLocalTape(), handle);
171166
}
@@ -206,7 +201,7 @@ void opdi::MutexOmpLogic::onMutexReleased(MutexKind mutexKind, WaitId waitId) {
206201
Handle* handle = new Handle;
207202
handle->data = static_cast<void*>(data);
208203
handle->reverseFunc = MutexOmpLogic::waitReverseFunc;
209-
handle->deleteFunc = MutexOmpLogic::waitDeleteFunc;
204+
handle->deleteFunc = MutexOmpLogic::deleteFunc;
210205

211206
tool->pushExternalFunction(tool->getThreadLocalTape(), handle);
212207
}

include/opdi/logic/omp/mutexOmpLogic.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,8 @@ namespace opdi {
8989
void checkKind(MutexKind mutexKind);
9090

9191
static void waitReverseFunc(void* dataPtr);
92-
static void waitDeleteFunc(void* dataPtr);
93-
9492
static void decrementReverseFunc(void* dataPtr);
95-
static void decrementDeleteFunc(void* dataPtr);
93+
static void deleteFunc(void* dataPtr);
9694

9795
protected:
9896

0 commit comments

Comments
 (0)