mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
actually build cpulimit support if SIGXCPU is available
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1005 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
441362a50b
commit
16a275a9fd
2 changed files with 8 additions and 4 deletions
|
|
@ -204,7 +204,10 @@ AC_TYPE_OFF_T
|
||||||
AC_TYPE_SIGNAL
|
AC_TYPE_SIGNAL
|
||||||
AC_TYPE_UID_T
|
AC_TYPE_UID_T
|
||||||
|
|
||||||
AC_CHECK_DEFINE([SIGXCPU], [signal.h], [HAVE_SIGXCPU=1], [HAVE_SIGXCPU=0])
|
AC_CHECK_DEFINE([SIGXCPU], [signal.h], [
|
||||||
|
HAVE_SIGXCPU=1
|
||||||
|
AC_DEFINE([HAVE_SIGXCPU], 1, [Have SIGXCPU?])
|
||||||
|
], [HAVE_SIGXCPU=0])
|
||||||
AM_CONDITIONAL(HAVE_SIGXCPU, test "x$HAVE_SIGXCPU" = "x1")
|
AM_CONDITIONAL(HAVE_SIGXCPU, test "x$HAVE_SIGXCPU" = "x1")
|
||||||
|
|
||||||
# Solaris lacks this
|
# Solaris lacks this
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
#include <polyp/error.h>
|
#include <polyp/error.h>
|
||||||
|
|
||||||
#include <polypcore/core-util.h>
|
#include <polypcore/core-util.h>
|
||||||
|
#include <polypcore/core-error.h>
|
||||||
#include <polypcore/log.h>
|
#include <polypcore/log.h>
|
||||||
|
|
||||||
#include "cpulimit.h"
|
#include "cpulimit.h"
|
||||||
|
|
@ -62,8 +63,8 @@
|
||||||
/* Check every 10s */
|
/* Check every 10s */
|
||||||
#define CPUTIME_INTERVAL_SOFT (10)
|
#define CPUTIME_INTERVAL_SOFT (10)
|
||||||
|
|
||||||
/* Recheck after 2s */
|
/* Recheck after 5s */
|
||||||
#define CPUTIME_INTERVAL_HARD (2)
|
#define CPUTIME_INTERVAL_HARD (5)
|
||||||
|
|
||||||
/* Time of the last CPU load check */
|
/* Time of the last CPU load check */
|
||||||
static time_t last_time = 0;
|
static time_t last_time = 0;
|
||||||
|
|
@ -155,7 +156,7 @@ static void signal_handler(int sig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Callback for IO events on the FIFO */
|
/* Callback for IO events on the FIFO */
|
||||||
static void callback(pa_mainloop_api*m, pa_io_event*e, int fd, pa_io_event_flags f, void *userdata) {
|
static void callback(pa_mainloop_api*m, pa_io_event*e, int fd, pa_io_event_flags_t f, void *userdata) {
|
||||||
char c;
|
char c;
|
||||||
assert(m && e && f == PA_IO_EVENT_INPUT && e == io_event && fd == the_pipe[0]);
|
assert(m && e && f == PA_IO_EVENT_INPUT && e == io_event && fd == the_pipe[0]);
|
||||||
read(the_pipe[0], &c, sizeof(c));
|
read(the_pipe[0], &c, sizeof(c));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue