Browse Source

[0.99.21] add CHECK_PREEMPTION() macro to libjack

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@818 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
joq 21 years ago
parent
commit
7ec291780c
3 changed files with 32 additions and 1 deletions
  1. +12
    -1
      configure.ac
  2. +14
    -0
      jack/internal.h
  3. +6
    -0
      libjack/client.c

+ 12
- 1
configure.ac View File

@@ -15,7 +15,7 @@ dnl changes are made
dnl ---
JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=99
JACK_MICRO_VERSION=20
JACK_MICRO_VERSION=21

dnl ---
dnl HOWTO: updating the jack protocol version
@@ -318,6 +318,17 @@ AC_ARG_ENABLE(timestamps,
]
)

AC_ARG_ENABLE(preemption-check,
AC_HELP_STRING([--enable-preemption-check],
[check for inappropriate realtime preemption]),
[
if test x$enable_preemption_check != xno ; then
echo checking for realtime preemption bugs
AC_DEFINE(DO_PREEMPTION_CHECKING,,
[check realtime preemption])
fi
])

USE_CAPABILITIES=false

AC_ARG_ENABLE(capabilities,


+ 14
- 0
jack/internal.h View File

@@ -60,6 +60,20 @@ extern void jack_error (const char *fmt, ...);
#endif
#endif

/* Enable preemption checking for Linux Realtime Preemption kernels.
*
* This checks if any RT-safe code section does anything to cause
* possible CPU preemption. Examples are sleep() or other system
* calls that block. If a problem is detected, the kernel writes a
* syslog entry, and sends SIGUSR2 to the client.
*/
#ifdef DO_PREEMPTION_CHECKING
#define CHECK_PREEMPTION(engine, onoff) \
if ((engine)->real_time) gettimeofday (1, (onoff))
#else
#define CHECK_PREEMPTION(engine, onoff)
#endif

#ifndef FALSE
#define FALSE (0)
#endif


+ 6
- 0
libjack/client.c View File

@@ -1235,6 +1235,9 @@ jack_client_thread (void *arg)

control->state = Running;

/* begin preemption checking */
CHECK_PREEMPTION (client->engine, TRUE);
if (control->sync_cb)
jack_call_sync_client (client);

@@ -1251,6 +1254,9 @@ jack_client_thread (void *arg)
if (control->timebase_cb)
jack_call_timebase_master (client);

/* end preemption checking */
CHECK_PREEMPTION (client->engine, FALSE);

control->finished_at = jack_get_microseconds();

#ifdef WITH_TIMESTAMPS


Loading…
Cancel
Save