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
90b3780c
Commit
90b3780c
authored
Jul 01, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thread: move, fix and improve documentation
parent
1e928298
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
500 additions
and
327 deletions
+500
-327
include/vlc_threads.h
include/vlc_threads.h
+500
-39
src/os2/thread.c
src/os2/thread.c
+0
-3
src/posix/thread.c
src/posix/thread.c
+0
-240
src/posix/timer.c
src/posix/timer.c
+0
-44
src/win32/thread.c
src/win32/thread.c
+0
-1
No files found.
include/vlc_threads.h
View file @
90b3780c
This diff is collapsed.
Click to expand it.
src/os2/thread.c
View file @
90b3780c
...
@@ -49,9 +49,6 @@
...
@@ -49,9 +49,6 @@
static
vlc_threadvar_t
thread_key
;
static
vlc_threadvar_t
thread_key
;
/**
* Per-thread data
*/
struct
vlc_thread
struct
vlc_thread
{
{
TID
tid
;
TID
tid
;
...
...
src/posix/thread.c
View file @
90b3780c
This diff is collapsed.
Click to expand it.
src/posix/timer.c
View file @
90b3780c
...
@@ -98,17 +98,6 @@ static void *vlc_timer_thread (void *data)
...
@@ -98,17 +98,6 @@ static void *vlc_timer_thread (void *data)
vlc_assert_unreachable
();
vlc_assert_unreachable
();
}
}
/**
* Initializes an asynchronous timer.
* @warning Asynchronous timers are processed from an unspecified thread.
* Multiple occurences of a single interval timer are serialized; they cannot
* run concurrently.
*
* @param id pointer to timer to be initialized
* @param func function that the timer will call
* @param data parameter for the timer function
* @return 0 on success, a system error code otherwise.
*/
int
vlc_timer_create
(
vlc_timer_t
*
id
,
void
(
*
func
)
(
void
*
),
void
*
data
)
int
vlc_timer_create
(
vlc_timer_t
*
id
,
void
(
*
func
)
(
void
*
),
void
*
data
)
{
{
struct
vlc_timer
*
timer
=
malloc
(
sizeof
(
*
timer
));
struct
vlc_timer
*
timer
=
malloc
(
sizeof
(
*
timer
));
...
@@ -137,15 +126,6 @@ int vlc_timer_create (vlc_timer_t *id, void (*func) (void *), void *data)
...
@@ -137,15 +126,6 @@ int vlc_timer_create (vlc_timer_t *id, void (*func) (void *), void *data)
return
0
;
return
0
;
}
}
/**
* Destroys an initialized timer. If needed, the timer is first disarmed.
* This function is undefined if the specified timer is not initialized.
*
* @warning This function <b>must</b> be called before the timer data can be
* freed and before the timer callback function can be unloaded.
*
* @param timer timer to destroy
*/
void
vlc_timer_destroy
(
vlc_timer_t
timer
)
void
vlc_timer_destroy
(
vlc_timer_t
timer
)
{
{
vlc_cancel
(
timer
->
thread
);
vlc_cancel
(
timer
->
thread
);
...
@@ -155,23 +135,6 @@ void vlc_timer_destroy (vlc_timer_t timer)
...
@@ -155,23 +135,6 @@ void vlc_timer_destroy (vlc_timer_t timer)
free
(
timer
);
free
(
timer
);
}
}
/**
* Arm or disarm an initialized timer.
* This functions overrides any previous call to itself.
*
* @note A timer can fire later than requested due to system scheduling
* limitations. An interval timer can fail to trigger sometimes, either because
* the system is busy or suspended, or because a previous iteration of the
* timer is still running. See also vlc_timer_getoverrun().
*
* @param timer initialized timer
* @param absolute the timer value origin is the same as mdate() if true,
* the timer value is relative to now if false.
* @param value zero to disarm the timer, otherwise the initial time to wait
* before firing the timer.
* @param interval zero to fire the timer just once, otherwise the timer
* repetition interval.
*/
void
vlc_timer_schedule
(
vlc_timer_t
timer
,
bool
absolute
,
void
vlc_timer_schedule
(
vlc_timer_t
timer
,
bool
absolute
,
mtime_t
value
,
mtime_t
interval
)
mtime_t
value
,
mtime_t
interval
)
{
{
...
@@ -185,13 +148,6 @@ void vlc_timer_schedule (vlc_timer_t timer, bool absolute,
...
@@ -185,13 +148,6 @@ void vlc_timer_schedule (vlc_timer_t timer, bool absolute,
vlc_mutex_unlock
(
&
timer
->
lock
);
vlc_mutex_unlock
(
&
timer
->
lock
);
}
}
/**
* Fetch and reset the overrun counter for a timer.
* @param timer initialized timer
* @return the timer overrun counter, i.e. the number of times that the timer
* should have run but did not since the last actual run. If all is well, this
* is zero.
*/
unsigned
vlc_timer_getoverrun
(
vlc_timer_t
timer
)
unsigned
vlc_timer_getoverrun
(
vlc_timer_t
timer
)
{
{
return
atomic_exchange_explicit
(
&
timer
->
overruns
,
0
,
return
atomic_exchange_explicit
(
&
timer
->
overruns
,
0
,
...
...
src/win32/thread.c
View file @
90b3780c
...
@@ -443,7 +443,6 @@ retry:
...
@@ -443,7 +443,6 @@ retry:
/*** Threads ***/
/*** Threads ***/
static
DWORD
thread_key
;
static
DWORD
thread_key
;
/** Per-thread data */
struct
vlc_thread
struct
vlc_thread
{
{
HANDLE
id
;
HANDLE
id
;
...
...
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