Skip to content

Commit fe6db25

Browse files
committed
Updated recursive counter check
1 parent 368f3c0 commit fe6db25

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dev/connection_holder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace sqlite_orm {
3434
maybe_lock(std::binary_semaphore& sync, bool shouldLock) noexcept(noexcept(sync.acquire())) :
3535
isSynced{shouldLock}, sync{sync} {
3636
if (isSynced) {
37-
if (++nRecursionsPerThread == 1) [[likely]] {
37+
if (nRecursionsPerThread++ == 0) [[likely]] {
3838
sync.acquire();
3939
}
4040
}

include/sqlite_orm/sqlite_orm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14661,7 +14661,7 @@ namespace sqlite_orm {
1466114661
maybe_lock(std::binary_semaphore& sync, bool shouldLock) noexcept(noexcept(sync.acquire())) :
1466214662
isSynced{shouldLock}, sync{sync} {
1466314663
if (isSynced) {
14664-
if (++nRecursionsPerThread == 1) [[likely]] {
14664+
if (nRecursionsPerThread++ == 0) [[likely]] {
1466514665
sync.acquire();
1466614666
}
1466714667
}

0 commit comments

Comments
 (0)