-
Notifications
You must be signed in to change notification settings - Fork 851
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
[core] Introduced the CSharedResource #2293
[core] Introduced the CSharedResource #2293
Conversation
A similar thing has been already introduced for the use of group locking - the This is currently built in into the group, but could be abstracted out for more purposes, and maybe in future it could be also used for sockets in order to prevent any still hanging around risks of deleting a socket being in use in another thread. |
It looks like |
The "shared resource" type is introduced exactly in order to not lock mutexes guarding the container access in order to run some longer procedure on an object contained in this container. |
It looks like |
No. This is for objects potentially being used by multiple threads at a time and at some point they have to be deleted. |
If all users of the shared_ptr (from different threads) end, the resource will be deleted automatically. |
c3916f3
to
f060f86
Compare
srt::sync::CThread::id: added the default constructor, dropped constantness.
by acquiring the m_ConnectionResources. Fixes Haivision#2234.
c2a2d35
to
559c49d
Compare
For example, |
Closing as outdated and partially covered by PR #2981 (a SharedMutex class). |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2293 +/- ##
==========================================
+ Coverage 65.67% 65.93% +0.25%
==========================================
Files 95 95
Lines 19520 19569 +49
==========================================
+ Hits 12819 12902 +83
+ Misses 6701 6667 -34 ☔ View full report in Codecov by Sentry. |
NB! The description is outdated, as now issue #2234 is being addressed in this PR.
Introducing the
CSharedResource
class. Not yet used in the code. Potentially them_ConnectionLock
can be converted to theCSharedResource
.