Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
b187d11b
Commit
b187d11b
authored
May 14, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detach dying objects atomically, so FIND_CHILDREN is safe
parent
58a1d71b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
src/misc/objects.c
src/misc/objects.c
+19
-11
No files found.
src/misc/objects.c
View file @
b187d11b
...
@@ -83,6 +83,7 @@ static int CountChildren ( vlc_object_t *, int );
...
@@ -83,6 +83,7 @@ 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_detach_unlocked
(
vlc_object_t
*
p_this
);
/*****************************************************************************
/*****************************************************************************
* Local structure lock
* Local structure lock
...
@@ -315,9 +316,8 @@ static void vlc_object_destroy( vlc_object_t *p_this )
...
@@ -315,9 +316,8 @@ static void vlc_object_destroy( vlc_object_t *p_this )
{
{
vlc_object_internals_t
*
p_priv
=
vlc_internals
(
p_this
);
vlc_object_internals_t
*
p_priv
=
vlc_internals
(
p_this
);
/* Automatically detach the object from its parent */
/* Objects are always detached beforehand */
if
(
p_this
->
p_parent
)
vlc_object_detach
(
p_this
);
assert
(
!
p_this
->
p_parent
);
/* Send a kill to the object's thread if applicable */
/* Send a kill to the object's thread if applicable */
vlc_object_kill
(
p_this
);
vlc_object_kill
(
p_this
);
...
@@ -884,6 +884,8 @@ void __vlc_object_release( vlc_object_t *p_this )
...
@@ -884,6 +884,8 @@ void __vlc_object_release( vlc_object_t *p_this )
p_libvlc_global
->
i_objects
);
p_libvlc_global
->
i_objects
);
REMOVE_ELEM
(
p_libvlc_global
->
pp_objects
,
REMOVE_ELEM
(
p_libvlc_global
->
pp_objects
,
p_libvlc_global
->
i_objects
,
i_index
);
p_libvlc_global
->
i_objects
,
i_index
);
if
(
p_this
->
p_parent
)
vlc_object_detach_unlocked
(
p_this
);
}
}
vlc_mutex_unlock
(
&
structure_lock
);
vlc_mutex_unlock
(
&
structure_lock
);
...
@@ -921,6 +923,19 @@ void __vlc_object_attach( vlc_object_t *p_this, vlc_object_t *p_parent )
...
@@ -921,6 +923,19 @@ void __vlc_object_attach( vlc_object_t *p_this, vlc_object_t *p_parent )
vlc_mutex_unlock
(
&
structure_lock
);
vlc_mutex_unlock
(
&
structure_lock
);
}
}
static
void
vlc_object_detach_unlocked
(
vlc_object_t
*
p_this
)
{
assert
(
p_this
->
p_parent
);
/* Climb up the tree to see whether we are connected with the root */
if
(
vlc_internals
(
p_this
->
p_parent
)
->
b_attached
)
SetAttachment
(
p_this
,
false
);
DetachObject
(
p_this
);
}
/**
/**
****************************************************************************
****************************************************************************
* detach object from its parent
* detach object from its parent
...
@@ -940,15 +955,8 @@ void __vlc_object_detach( vlc_object_t *p_this )
...
@@ -940,15 +955,8 @@ void __vlc_object_detach( vlc_object_t *p_this )
return
;
return
;
}
}
/* Climb up the tree to see whether we are connected with the root */
vlc_object_detach_unlocked
(
p_this
);
if
(
vlc_internals
(
p_this
->
p_parent
)
->
b_attached
)
{
SetAttachment
(
p_this
,
false
);
}
DetachObject
(
p_this
);
vlc_mutex_unlock
(
&
structure_lock
);
vlc_mutex_unlock
(
&
structure_lock
);
p_this
=
NULL
;
}
}
/**
/**
...
...
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