Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
4bacd996
Commit
4bacd996
authored
Feb 27, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
misc/objects: No need to do atomic list-release when releasing the list.
parent
68aaf2c9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
18 deletions
+3
-18
src/misc/objects.c
src/misc/objects.c
+3
-18
No files found.
src/misc/objects.c
View file @
4bacd996
...
@@ -75,12 +75,6 @@
...
@@ -75,12 +75,6 @@
/*****************************************************************************
/*****************************************************************************
* Local prototypes
* Local prototypes
*****************************************************************************/
*****************************************************************************/
typedef
enum
vlc_lock_state_t
{
vlc_Locked
,
vlc_Unlocked
}
vlc_lock_state_t
;
static
int
DumpCommand
(
vlc_object_t
*
,
char
const
*
,
static
int
DumpCommand
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_value_t
,
vlc_value_t
,
void
*
);
...
@@ -99,7 +93,6 @@ static int CountChildren ( vlc_object_t *, int );
...
@@ -99,7 +93,6 @@ static int CountChildren ( vlc_object_t *, int );
static
void
ListChildren
(
vlc_list_t
*
,
vlc_object_t
*
,
int
);
static
void
ListChildren
(
vlc_list_t
*
,
vlc_object_t
*
,
int
);
static
void
vlc_object_destroy
(
vlc_object_t
*
p_this
);
static
void
vlc_object_destroy
(
vlc_object_t
*
p_this
);
static
void
vlc_object_release_locked
(
vlc_object_t
*
p_this
,
vlc_lock_state_t
locked
);
/*****************************************************************************
/*****************************************************************************
* Local structure lock
* Local structure lock
...
@@ -887,16 +880,10 @@ void __vlc_object_yield( vlc_object_t *p_this )
...
@@ -887,16 +880,10 @@ void __vlc_object_yield( vlc_object_t *p_this )
* And destroy the object if its refcount reach zero.
* And destroy the object if its refcount reach zero.
*****************************************************************************/
*****************************************************************************/
void
__vlc_object_release
(
vlc_object_t
*
p_this
)
void
__vlc_object_release
(
vlc_object_t
*
p_this
)
{
vlc_object_release_locked
(
p_this
,
vlc_Unlocked
);
}
/* Version without the lock */
static
void
vlc_object_release_locked
(
vlc_object_t
*
p_this
,
vlc_lock_state_t
locked
)
{
{
vlc_bool_t
b_should_destroy
;
vlc_bool_t
b_should_destroy
;
if
(
locked
==
vlc_Unlocked
)
vlc_mutex_lock
(
&
structure_lock
);
vlc_mutex_lock
(
&
structure_lock
);
assert
(
p_this
->
p_internals
->
i_refcount
>
0
);
assert
(
p_this
->
p_internals
->
i_refcount
>
0
);
p_this
->
p_internals
->
i_refcount
--
;
p_this
->
p_internals
->
i_refcount
--
;
...
@@ -917,7 +904,7 @@ static void vlc_object_release_locked( vlc_object_t *p_this, vlc_lock_state_t lo
...
@@ -917,7 +904,7 @@ static void vlc_object_release_locked( vlc_object_t *p_this, vlc_lock_state_t lo
p_libvlc_global
->
i_objects
,
i_index
);
p_libvlc_global
->
i_objects
,
i_index
);
}
}
if
(
locked
==
vlc_Unlocked
)
vlc_mutex_unlock
(
&
structure_lock
);
vlc_mutex_unlock
(
&
structure_lock
);
if
(
b_should_destroy
)
if
(
b_should_destroy
)
vlc_object_destroy
(
p_this
);
vlc_object_destroy
(
p_this
);
...
@@ -1241,12 +1228,10 @@ void vlc_list_release( vlc_list_t *p_list )
...
@@ -1241,12 +1228,10 @@ void vlc_list_release( vlc_list_t *p_list )
{
{
int
i_index
;
int
i_index
;
vlc_mutex_lock
(
&
structure_lock
);
for
(
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
for
(
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
{
{
vlc_object_release
_locked
(
p_list
->
p_values
[
i_index
].
p_object
,
vlc_Locked
);
vlc_object_release
(
p_list
->
p_values
[
i_index
].
p_object
);
}
}
vlc_mutex_unlock
(
&
structure_lock
);
free
(
p_list
->
p_values
);
free
(
p_list
->
p_values
);
free
(
p_list
);
free
(
p_list
);
...
...
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