Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
46ffb1cd
Commit
46ffb1cd
authored
May 16, 2008
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "vlc_object_release: cleanup"
This reverts commit
c85f8681
.
parent
5d93a7ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
19 deletions
+30
-19
src/misc/objects.c
src/misc/objects.c
+30
-19
No files found.
src/misc/objects.c
View file @
46ffb1cd
...
@@ -840,23 +840,32 @@ void __vlc_object_yield( vlc_object_t *p_this )
...
@@ -840,23 +840,32 @@ void __vlc_object_yield( vlc_object_t *p_this )
void
__vlc_object_release
(
vlc_object_t
*
p_this
)
void
__vlc_object_release
(
vlc_object_t
*
p_this
)
{
{
vlc_object_internals_t
*
internals
=
vlc_internals
(
p_this
);
vlc_object_internals_t
*
internals
=
vlc_internals
(
p_this
);
bool
b_should_destroy
;
vlc_spin_lock
(
&
internals
->
ref_spin
);
vlc_spin_lock
(
&
internals
->
ref_spin
);
assert
(
internals
->
i_refcount
>
0
);
assert
(
internals
->
i_refcount
>
0
);
if
(
--
internals
->
i_refcount
)
if
(
internals
->
i_refcount
>
1
)
{
{
/* Fast path */
/* Fast path */
/* There are still other references to the object */
/* There are still other references to the object */
internals
->
i_refcount
--
;
vlc_spin_unlock
(
&
internals
->
ref_spin
);
vlc_spin_unlock
(
&
internals
->
ref_spin
);
return
;
return
;
}
}
vlc_spin_unlock
(
&
internals
->
ref_spin
);
vlc_spin_unlock
(
&
internals
->
ref_spin
);
/* Slow path
: object destruction
*/
/* Slow path */
/* Remember that we cannot hold the spin while waiting on the mutex */
/* Remember that we cannot hold the spin while waiting on the mutex */
vlc_mutex_lock
(
&
structure_lock
);
vlc_mutex_lock
(
&
structure_lock
);
/* Take the spin again. Note that another thread may have yielded the
* object in the (very short) mean time. */
vlc_spin_lock
(
&
internals
->
ref_spin
);
b_should_destroy
=
--
internals
->
i_refcount
==
0
;
vlc_spin_unlock
(
&
internals
->
ref_spin
);
if
(
b_should_destroy
)
{
/* Remove the object from the table
/* Remove the object from the table
* so that it cannot be encountered by vlc_object_get() */
* so that it cannot be encountered by vlc_object_get() */
libvlc_global_data_t
*
p_libvlc_global
=
vlc_global
();
libvlc_global_data_t
*
p_libvlc_global
=
vlc_global
();
...
@@ -873,9 +882,11 @@ void __vlc_object_release( vlc_object_t *p_this )
...
@@ -873,9 +882,11 @@ void __vlc_object_release( vlc_object_t *p_this )
/* Detach from children to protect against FIND_PARENT */
/* Detach from children to protect against FIND_PARENT */
for
(
int
i
=
0
;
i
<
p_this
->
i_children
;
i
++
)
for
(
int
i
=
0
;
i
<
p_this
->
i_children
;
i
++
)
p_this
->
pp_children
[
i
]
->
p_parent
=
NULL
;
p_this
->
pp_children
[
i
]
->
p_parent
=
NULL
;
}
vlc_mutex_unlock
(
&
structure_lock
);
vlc_mutex_unlock
(
&
structure_lock
);
if
(
b_should_destroy
)
vlc_object_destroy
(
p_this
);
vlc_object_destroy
(
p_this
);
}
}
...
...
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