Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
b1b63c31
Commit
b1b63c31
authored
May 07, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No need to take the structure lock when finding oneself
as we don't go through the object table and links.
parent
ef33cb40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
src/misc/objects.c
src/misc/objects.c
+4
-8
No files found.
src/misc/objects.c
View file @
b1b63c31
...
@@ -742,18 +742,15 @@ void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode )
...
@@ -742,18 +742,15 @@ void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode )
{
{
vlc_object_t
*
p_found
;
vlc_object_t
*
p_found
;
vlc_mutex_lock
(
&
structure_lock
);
assert
(
vlc_internals
(
p_this
)
->
i_refcount
>
0
);
/* If we are of the requested type ourselves, don't look further */
/* If we are of the requested type ourselves, don't look further */
if
(
!
(
i_mode
&
FIND_STRICT
)
&&
p_this
->
i_object_type
==
i_type
)
if
(
!
(
i_mode
&
FIND_STRICT
)
&&
p_this
->
i_object_type
==
i_type
)
{
{
vlc_object_yield
(
p_this
);
vlc_object_yield
(
p_this
);
vlc_mutex_unlock
(
&
structure_lock
);
return
p_this
;
return
p_this
;
}
}
vlc_mutex_lock
(
&
structure_lock
);
/* Otherwise, recursively look for the object */
/* Otherwise, recursively look for the object */
if
(
(
i_mode
&
0x000f
)
==
FIND_ANYWHERE
)
if
(
(
i_mode
&
0x000f
)
==
FIND_ANYWHERE
)
{
{
...
@@ -795,18 +792,17 @@ void * __vlc_object_find_name( vlc_object_t *p_this, const char *psz_name,
...
@@ -795,18 +792,17 @@ void * __vlc_object_find_name( vlc_object_t *p_this, const char *psz_name,
{
{
vlc_object_t
*
p_found
;
vlc_object_t
*
p_found
;
vlc_mutex_lock
(
&
structure_lock
);
/* If have the requested name ourselves, don't look further */
/* If have the requested name ourselves, don't look further */
if
(
!
(
i_mode
&
FIND_STRICT
)
if
(
!
(
i_mode
&
FIND_STRICT
)
&&
p_this
->
psz_object_name
&&
p_this
->
psz_object_name
&&
!
strcmp
(
p_this
->
psz_object_name
,
psz_name
)
)
&&
!
strcmp
(
p_this
->
psz_object_name
,
psz_name
)
)
{
{
vlc_object_yield
(
p_this
);
vlc_object_yield
(
p_this
);
vlc_mutex_unlock
(
&
structure_lock
);
return
p_this
;
return
p_this
;
}
}
vlc_mutex_lock
(
&
structure_lock
);
/* Otherwise, recursively look for the object */
/* Otherwise, recursively look for the object */
if
(
(
i_mode
&
0x000f
)
==
FIND_ANYWHERE
)
if
(
(
i_mode
&
0x000f
)
==
FIND_ANYWHERE
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment