refactor: Make tox mutex non-recursive.#2652
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2652 +/- ##
==========================================
+ Coverage 73.61% 73.66% +0.05%
==========================================
Files 148 148
Lines 30404 30481 +77
==========================================
+ Hits 22382 22455 +73
- Misses 8022 8026 +4 ☔ View full report in Codecov by Sentry. |
robinlinden
left a comment
There was a problem hiding this comment.
Guess we're missing a test that sets the conference title and a test that actually uses the experimental thread safety option?
2f7f826 to
a18412a
Compare
nurupo
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 change requests, 1 of 1 approvals obtained (waiting on @iphydf)
toxcore/tox.c line 89 at r1 (raw file):
if (tox->log_callback != nullptr) { tox->log_callback(tox, (Tox_Log_Level)level, file, line, func, message, userdata);
Is locking not needed here?
iphydf
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 change requests, 1 of 1 approvals obtained (waiting on @nurupo)
toxcore/tox.c line 89 at r1 (raw file):
Previously, nurupo wrote…
Is locking not needed here?
More accurately, unlocking is not needed here. The log callback happens in really any kind of situation, and client could should never call tox functions inside the log callback.
|
Previously, iphydf wrote…
Is this documented somewhere? I don't see a mentioning of this where the callback is defined in tox.h. Also, for what purpose does the callback pass |
a18412a to
5daedb8
Compare
iphydf
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 change requests, 1 of 1 approvals obtained (waiting on @nurupo)
toxcore/tox.c line 89 at r1 (raw file):
Previously, nurupo wrote…
Is this documented somewhere? I don't see a mentioning of this where the callback is defined in tox.h.
Also, for what purpose does the callback pass
Tox *toxto the user if it's not to be used? (I guess to use of operator== ontoxagainst some other Tox instance might be a valid use-case?)
Passing Tox to log callbacks was a mistake. Added a comment to the log_callback docs.
Instead, unlock it before entering client callback code.
5daedb8 to
5c93231
Compare
|
Previously, iphydf wrote…
Do we want to remove |
iphydf
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 change requests, 1 of 1 approvals obtained (waiting on @nurupo)
toxcore/tox.c line 89 at r1 (raw file):
Previously, nurupo wrote…
Do we want to remove
Tox *toxfromtox_log_cbwhen we break the API in the future? If so, might be worth noting this somewhere so that we don't forget, e.g. create an issue mentioning it or add a note totox_log_cbtox.h for ourselves.
Done.
nurupo
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r1, 1 of 1 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status:complete! 2 of 1 approvals obtained
Instead, unlock it before entering client callback code.
This change is