-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup of stuff #6
Merged
Merged
Conversation
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
9e1b5a6
to
f5c13ac
Compare
* Move constant lookup tables. * Remove declarations of helper template functions from header (template definitions are in source file anyway). * Sort method implementations s.t. they are in the same order as in the header.
Move functions as well and remove static keyword.
You do not need typedef structs in C++. This is just annoying for forward declarations.
* Use member initializer list. * Use unique_ptr for CLock* members.
The functions can be replaced with standard library functionality: * std::filesystem::exists * std::filesystem::file_size * std::filesystem::is_empty
* Move implementation to .cpp file
I have no idea if the Windows implementation still works.
* Removed CGrabLock which can be replaced with std::lock_guard and CThread::Kill which is unused and misleading. * The mutex is marked as `mutable` s.t. it can be locked in a const method (e.g. IsSet). * Add CLock::lock and Clock::unlock s.t. CLock can be used with std::lock_guard etc.
This should prevent a race when flush_queue is executed while the thread is still running and possibly adding more items to the queue.
The access from crypto::gen_rnd is now synchronized.
Each queue in a `rcv_task` has now an accompanying mutex which is used by the `RcvThread` and `channel`s.
Adds mutexes for send/recv counters as they are often used from other threads. Also make methods const if possible.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is work in progress.