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
a22e0f27
Commit
a22e0f27
authored
Mar 05, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Privatize the object pipe lock
parent
31bdf929
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/misc/objects.c
src/misc/objects.c
+6
-4
No files found.
src/misc/objects.c
View file @
a22e0f27
...
@@ -370,6 +370,8 @@ error:
...
@@ -370,6 +370,8 @@ error:
#define close( a ) closesocket (a)
#define close( a ) closesocket (a)
#endif
/* WIN32 */
#endif
/* WIN32 */
static
vlc_mutex_t
pipe_lock
=
VLC_STATIC_MUTEX
;
/**
/**
* Returns the readable end of a pipe that becomes readable once termination
* Returns the readable end of a pipe that becomes readable once termination
* of the object is requested (vlc_object_kill()).
* of the object is requested (vlc_object_kill()).
...
@@ -386,7 +388,7 @@ int vlc_object_waitpipe( vlc_object_t *obj )
...
@@ -386,7 +388,7 @@ int vlc_object_waitpipe( vlc_object_t *obj )
{
{
vlc_object_internals_t
*
internals
=
vlc_internals
(
obj
);
vlc_object_internals_t
*
internals
=
vlc_internals
(
obj
);
vlc_
object_lock
(
obj
);
vlc_
mutex_lock
(
&
pipe_lock
);
if
(
internals
->
pipes
[
0
]
==
-
1
)
if
(
internals
->
pipes
[
0
]
==
-
1
)
{
{
/* This can only ever happen if someone killed us without locking: */
/* This can only ever happen if someone killed us without locking: */
...
@@ -407,7 +409,7 @@ int vlc_object_waitpipe( vlc_object_t *obj )
...
@@ -407,7 +409,7 @@ int vlc_object_waitpipe( vlc_object_t *obj )
write
(
internals
->
pipes
[
1
],
&
(
uint64_t
){
1
},
sizeof
(
uint64_t
));
write
(
internals
->
pipes
[
1
],
&
(
uint64_t
){
1
},
sizeof
(
uint64_t
));
}
}
}
}
vlc_
object_unlock
(
obj
);
vlc_
mutex_unlock
(
&
pipe_lock
);
return
internals
->
pipes
[
0
];
return
internals
->
pipes
[
0
];
}
}
...
@@ -422,7 +424,7 @@ void __vlc_object_kill( vlc_object_t *p_this )
...
@@ -422,7 +424,7 @@ void __vlc_object_kill( vlc_object_t *p_this )
int
fd
=
-
1
;
int
fd
=
-
1
;
vlc_thread_cancel
(
p_this
);
vlc_thread_cancel
(
p_this
);
vlc_
object_lock
(
p_this
);
vlc_
mutex_lock
(
&
pipe_lock
);
if
(
!
p_this
->
b_die
)
if
(
!
p_this
->
b_die
)
{
{
fd
=
priv
->
pipes
[
1
];
fd
=
priv
->
pipes
[
1
];
...
@@ -430,7 +432,7 @@ void __vlc_object_kill( vlc_object_t *p_this )
...
@@ -430,7 +432,7 @@ void __vlc_object_kill( vlc_object_t *p_this )
}
}
/* This also serves as a memory barrier toward vlc_object_alive(): */
/* This also serves as a memory barrier toward vlc_object_alive(): */
vlc_
object_unlock
(
p_this
);
vlc_
mutex_unlock
(
&
pipe_lock
);
if
(
fd
!=
-
1
)
if
(
fd
!=
-
1
)
{
{
...
...
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