-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing clang-tidy fixes (#3715)
- Loading branch information
1 parent
7f97581
commit dc9803c
Showing
6 changed files
with
40 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,9 +65,10 @@ class gil_scoped_acquire { | |
if (!tstate) { | ||
tstate = PyThreadState_New(internals.istate); | ||
#if !defined(NDEBUG) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rwgk
via email
Collaborator
|
||
if (!tstate) | ||
pybind11_fail("scoped_acquire: could not create thread state!"); | ||
#endif | ||
if (!tstate) { | ||
pybind11_fail("scoped_acquire: could not create thread state!"); | ||
} | ||
#endif | ||
tstate->gilstate_counter = 0; | ||
PYBIND11_TLS_REPLACE_VALUE(internals.tstate, tstate); | ||
} else { | ||
|
@@ -88,16 +89,19 @@ class gil_scoped_acquire { | |
PYBIND11_NOINLINE void dec_ref() { | ||
--tstate->gilstate_counter; | ||
#if !defined(NDEBUG) | ||
if (detail::get_thread_state_unchecked() != tstate) | ||
pybind11_fail("scoped_acquire::dec_ref(): thread state must be current!"); | ||
if (tstate->gilstate_counter < 0) | ||
pybind11_fail("scoped_acquire::dec_ref(): reference count underflow!"); | ||
#endif | ||
if (detail::get_thread_state_unchecked() != tstate) { | ||
pybind11_fail("scoped_acquire::dec_ref(): thread state must be current!"); | ||
} | ||
if (tstate->gilstate_counter < 0) { | ||
pybind11_fail("scoped_acquire::dec_ref(): reference count underflow!"); | ||
} | ||
#endif | ||
if (tstate->gilstate_counter == 0) { | ||
#if !defined(NDEBUG) | ||
if (!release) | ||
pybind11_fail("scoped_acquire::dec_ref(): internal error!"); | ||
#endif | ||
if (!release) { | ||
pybind11_fail("scoped_acquire::dec_ref(): internal error!"); | ||
} | ||
#endif | ||
PyThreadState_Clear(tstate); | ||
if (active) { | ||
PyThreadState_DeleteCurrent(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@rwgk Probably should have fixed these ifdefs move, but whatever.