Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
fc04df0b
Commit
fc04df0b
authored
Feb 20, 2001
by
Jean-Marc Dressler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the BeOS code for vlc_mutex_destroy() and vlc_cond_destroy()
parent
fdcd1cca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
include/threads.h
include/threads.h
+13
-9
No files found.
include/threads.h
View file @
fc04df0b
...
@@ -287,9 +287,11 @@ static __inline__ int vlc_mutex_destroy( vlc_mutex_t *p_mutex )
...
@@ -287,9 +287,11 @@ static __inline__ int vlc_mutex_destroy( vlc_mutex_t *p_mutex )
{
{
#if defined(HAVE_PTHREAD_H)
#if defined(HAVE_PTHREAD_H)
return
pthread_mutex_destroy
(
p_mutex
);
return
pthread_mutex_destroy
(
p_mutex
);
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
return
0
;
if
(
p_mutex
->
init
==
9999
)
delete_sem
(
p_mutex
->
lock
);
p_mutex
->
init
=
0
;
return
B_OK
;
#endif
#endif
}
}
...
@@ -346,27 +348,27 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
...
@@ -346,27 +348,27 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
if
(
p_condvar
->
init
<
2000
)
if
(
p_condvar
->
init
<
2000
)
return
B_NO_INIT
;
return
B_NO_INIT
;
while
(
p_condvar
->
thread
!=
-
1
)
while
(
p_condvar
->
thread
!=
-
1
)
{
{
thread_info
info
;
thread_info
info
;
if
(
get_thread_info
(
p_condvar
->
thread
,
&
info
)
==
B_BAD_VALUE
)
if
(
get_thread_info
(
p_condvar
->
thread
,
&
info
)
==
B_BAD_VALUE
)
return
0
;
return
0
;
// is the thread sleeping ?
if
(
info
.
state
!=
B_THREAD_SUSPENDED
)
if
(
info
.
state
!=
B_THREAD_SUSPENDED
)
{
{
// wait a little
// The waiting thread is not suspended so it could
// have been interrupted beetwen the unlock and the
// suspend_thread line. That is why we sleep a little
// before retesting p_condver->thread.
snooze
(
10000
);
snooze
(
10000
);
}
}
else
else
{
{
//
o
k, we have to wake up that thread
//
O
k, we have to wake up that thread
resume_thread
(
p_condvar
->
thread
);
resume_thread
(
p_condvar
->
thread
);
return
0
;
return
0
;
}
}
}
}
return
0
;
return
0
;
#endif
#endif
...
@@ -394,6 +396,9 @@ static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex
...
@@ -394,6 +396,9 @@ static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex
if
(
p_condvar
->
init
<
2000
)
if
(
p_condvar
->
init
<
2000
)
return
B_NO_INIT
;
return
B_NO_INIT
;
// The p_condvar->thread var is initialized before the unlock because
// it enables to identify when the thread is interrupted beetwen the
// unlock line and the suspend_thread line
p_condvar
->
thread
=
find_thread
(
NULL
);
p_condvar
->
thread
=
find_thread
(
NULL
);
vlc_mutex_unlock
(
p_mutex
);
vlc_mutex_unlock
(
p_mutex
);
suspend_thread
(
p_condvar
->
thread
);
suspend_thread
(
p_condvar
->
thread
);
...
@@ -412,9 +417,8 @@ static __inline__ int vlc_cond_destroy( vlc_cond_t *p_condvar )
...
@@ -412,9 +417,8 @@ static __inline__ int vlc_cond_destroy( vlc_cond_t *p_condvar )
{
{
#if defined(HAVE_PTHREAD_H)
#if defined(HAVE_PTHREAD_H)
return
pthread_cond_destroy
(
p_condvar
);
return
pthread_cond_destroy
(
p_condvar
);
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
p_condvar
->
init
=
0
;
return
0
;
return
0
;
#endif
#endif
}
}
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