Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gstreamer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
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
luzpaz
gstreamer
Commits
9555a7f8
Commit
9555a7f8
authored
Jun 02, 2011
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
element: inline the recursice state lock
parent
b5d35162
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
12 deletions
+5
-12
gst/gstelement.c
gst/gstelement.c
+3
-10
gst/gstelement.h
gst/gstelement.h
+2
-2
No files found.
gst/gstelement.c
View file @
9555a7f8
...
...
@@ -285,8 +285,7 @@ gst_element_init (GstElement * element)
GST_STATE_RETURN
(
element
)
=
GST_STATE_CHANGE_SUCCESS
;
/* FIXME 0.11: Store this directly in the instance struct */
element
->
state_lock
=
g_slice_new
(
GStaticRecMutex
);
g_static_rec_mutex_init
(
element
->
state_lock
);
g_static_rec_mutex_init
(
&
element
->
state_lock
);
element
->
state_cond
=
g_cond_new
();
}
...
...
@@ -2915,14 +2914,8 @@ gst_element_finalize (GObject * object)
GST_CAT_INFO_OBJECT
(
GST_CAT_REFCOUNTING
,
element
,
"finalize"
);
GST_STATE_LOCK
(
element
);
if
(
element
->
state_cond
)
g_cond_free
(
element
->
state_cond
);
element
->
state_cond
=
NULL
;
GST_STATE_UNLOCK
(
element
);
g_static_rec_mutex_free
(
element
->
state_lock
);
g_slice_free
(
GStaticRecMutex
,
element
->
state_lock
);
element
->
state_lock
=
NULL
;
g_cond_free
(
element
->
state_cond
);
g_static_rec_mutex_free
(
&
element
->
state_lock
);
GST_CAT_INFO_OBJECT
(
GST_CAT_REFCOUNTING
,
element
,
"finalize parent"
);
...
...
gst/gstelement.h
View file @
9555a7f8
...
...
@@ -487,7 +487,7 @@ G_STMT_START { \
* This lock is used by the core. It is taken while getting or setting
* the state, during state changes, and while finalizing.
*/
#define GST_STATE_GET_LOCK(elem) (
GST_ELEMENT_CAST(elem)->state_lock
)
#define GST_STATE_GET_LOCK(elem) (
&(GST_ELEMENT_CAST(elem)->state_lock)
)
/**
* GST_STATE_GET_COND:
* @elem: a #GstElement
...
...
@@ -544,7 +544,7 @@ struct _GstElement
GstObject
object
;
/*< public >*/
/* with LOCK */
GStaticRecMutex
*
state_lock
;
GStaticRecMutex
state_lock
;
/* element state */
GCond
*
state_cond
;
...
...
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