Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
f31b4f46
Commit
f31b4f46
authored
Dec 28, 2008
by
Thomas Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove xpthread_* wrappers
parent
1914e114
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
41 deletions
+11
-41
condition.c
src/condition.c
+10
-4
songvec.c
src/songvec.c
+1
-0
utils.c
src/utils.c
+0
-28
utils.h
src/utils.h
+0
-9
No files found.
src/condition.c
View file @
f31b4f46
...
...
@@ -26,8 +26,11 @@
void
cond_init
(
struct
condition
*
cond
)
{
xpthread_mutex_init
(
&
cond
->
mutex
,
NULL
);
xpthread_cond_init
(
&
cond
->
cond
,
NULL
);
int
err
;
if
((
err
=
pthread_mutex_init
(
&
cond
->
mutex
,
NULL
)))
FATAL
(
"failed to init mutex: %s
\n
"
,
strerror
(
err
));
if
((
err
=
pthread_cond_init
(
&
cond
->
cond
,
NULL
)))
FATAL
(
"failed to init cond: %s
\n
"
,
strerror
(
err
));
}
void
cond_enter
(
struct
condition
*
cond
)
...
...
@@ -82,6 +85,9 @@ void cond_signal_sync(struct condition *cond)
void
cond_destroy
(
struct
condition
*
cond
)
{
xpthread_cond_destroy
(
&
cond
->
cond
);
xpthread_mutex_destroy
(
&
cond
->
mutex
);
int
err
;
if
((
err
=
pthread_cond_destroy
(
&
cond
->
cond
)))
FATAL
(
"failed to destroy cond: %s
\n
"
,
strerror
(
err
));
if
((
err
=
pthread_mutex_destroy
(
&
cond
->
mutex
)))
FATAL
(
"failed to destroy mutex: %s
\n
"
,
strerror
(
err
));
}
src/songvec.c
View file @
f31b4f46
...
...
@@ -3,6 +3,7 @@
#include "utils.h"
#include <assert.h>
#include <pthread.h>
#include <string.h>
static
pthread_mutex_t
nr_lock
=
PTHREAD_MUTEX_INITIALIZER
;
...
...
src/utils.c
View file @
f31b4f46
...
...
@@ -196,34 +196,6 @@ void init_async_pipe(int file_des[2])
FATAL
(
"Couldn't set non-blocking I/O: %s
\n
"
,
strerror
(
errno
));
}
void
xpthread_mutex_init
(
pthread_mutex_t
*
m
,
const
pthread_mutexattr_t
*
a
)
{
int
err
;
if
((
err
=
pthread_mutex_init
(
m
,
a
)))
FATAL
(
"failed to init mutex: %s
\n
"
,
strerror
(
err
));
}
void
xpthread_cond_init
(
pthread_cond_t
*
c
,
pthread_condattr_t
*
a
)
{
int
err
;
if
((
err
=
pthread_cond_init
(
c
,
a
)))
FATAL
(
"failed to init cond: %s
\n
"
,
strerror
(
err
));
}
void
xpthread_mutex_destroy
(
pthread_mutex_t
*
mutex
)
{
int
err
;
if
((
err
=
pthread_mutex_destroy
(
mutex
)))
FATAL
(
"failed to destroy mutex: %s
\n
"
,
strerror
(
err
));
}
void
xpthread_cond_destroy
(
pthread_cond_t
*
cond
)
{
int
err
;
if
((
err
=
pthread_cond_destroy
(
cond
)))
FATAL
(
"failed to destroy cond: %s
\n
"
,
strerror
(
err
));
}
int
stringFoundInStringArray
(
const
char
*
const
*
array
,
const
char
*
suffix
)
{
while
(
array
&&
*
array
)
{
...
...
src/utils.h
View file @
f31b4f46
...
...
@@ -24,7 +24,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <pthread.h>
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
...
...
@@ -98,14 +97,6 @@ int set_nonblocking(int fd);
void
init_async_pipe
(
int
file_des
[
2
]);
void
xpthread_mutex_init
(
pthread_mutex_t
*
m
,
const
pthread_mutexattr_t
*
a
);
void
xpthread_cond_init
(
pthread_cond_t
*
c
,
pthread_condattr_t
*
a
);
void
xpthread_mutex_destroy
(
pthread_mutex_t
*
mutex
);
void
xpthread_cond_destroy
(
pthread_cond_t
*
cond
);
int
stringFoundInStringArray
(
const
char
*
const
*
array
,
const
char
*
suffix
);
#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