Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
9575a2e2
Commit
9575a2e2
authored
Nov 10, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove spin lock functions
This was not a particularly good idea in user space.
parent
51a26d08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
74 deletions
+0
-74
include/vlc_threads.h
include/vlc_threads.h
+0
-74
No files found.
include/vlc_threads.h
View file @
9575a2e2
...
@@ -411,80 +411,6 @@ static inline void vlc_cleanup_lock (void *lock)
...
@@ -411,80 +411,6 @@ static inline void vlc_cleanup_lock (void *lock)
}
}
#define mutex_cleanup_push( lock ) vlc_cleanup_push (vlc_cleanup_lock, lock)
#define mutex_cleanup_push( lock ) vlc_cleanup_push (vlc_cleanup_lock, lock)
#if defined (_POSIX_SPIN_LOCKS) && ((_POSIX_SPIN_LOCKS - 0) > 0)
typedef
pthread_spinlock_t
vlc_spinlock_t
;
/**
* Initializes a spinlock.
*/
static
inline
void
vlc_spin_init
(
vlc_spinlock_t
*
spin
)
{
if
(
pthread_spin_init
(
spin
,
PTHREAD_PROCESS_PRIVATE
))
abort
();
}
/**
* Acquires a spinlock.
*/
static
inline
void
vlc_spin_lock
(
vlc_spinlock_t
*
spin
)
{
pthread_spin_lock
(
spin
);
}
/**
* Releases a spinlock.
*/
static
inline
void
vlc_spin_unlock
(
vlc_spinlock_t
*
spin
)
{
pthread_spin_unlock
(
spin
);
}
/**
* Deinitializes a spinlock.
*/
static
inline
void
vlc_spin_destroy
(
vlc_spinlock_t
*
spin
)
{
pthread_spin_destroy
(
spin
);
}
#elif defined (WIN32)
typedef
CRITICAL_SECTION
vlc_spinlock_t
;
static
inline
void
vlc_spin_init
(
vlc_spinlock_t
*
spin
)
{
if
(
!
InitializeCriticalSectionAndSpinCount
(
spin
,
4000
))
abort
();
}
static
inline
void
vlc_spin_lock
(
vlc_spinlock_t
*
spin
)
{
EnterCriticalSection
(
spin
);
}
static
inline
void
vlc_spin_unlock
(
vlc_spinlock_t
*
spin
)
{
LeaveCriticalSection
(
spin
);
}
static
inline
void
vlc_spin_destroy
(
vlc_spinlock_t
*
spin
)
{
DeleteCriticalSection
(
spin
);
}
#else
/* Fallback to plain mutexes if spinlocks are not available */
typedef
vlc_mutex_t
vlc_spinlock_t
;
static
inline
void
vlc_spin_init
(
vlc_spinlock_t
*
spin
)
{
vlc_mutex_init
(
spin
);
}
# define vlc_spin_lock vlc_mutex_lock
# define vlc_spin_unlock vlc_mutex_unlock
# define vlc_spin_destroy vlc_mutex_destroy
#endif
#ifdef __cplusplus
#ifdef __cplusplus
/**
/**
* Helper C++ class to lock a mutex.
* Helper C++ class to lock a mutex.
...
...
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