Skip to content

Commit aefacea

Browse files
Lars LuthmanArnout Engelen
authored andcommitted
Added support for SMP systems
1 parent 43b0f66 commit aefacea

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

jack_interposer.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,27 @@
1111

1212
#define ABORT_ON_VIOLATION 1
1313

14+
// Define THREAD_LOCAL as the keyword for thread-local storage if the compiler
15+
// supports it.
16+
#if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
17+
#define THREAD_LOCAL __thread
18+
#else
19+
#define THREAD_LOCAL
20+
#endif
21+
1422
// is set to 'true' when entering the process-callback and to 'false' when
1523
// leaving it. When set to 'true', calls to non-realtime functions will
1624
// cause warnings/errors.
1725
//
18-
// This assumes there is only 1 thread running at a time, thus introducing
19-
// the limitation that jack_interposer is only usable on single-CPU machines
20-
// (or machines configured to run the application under test on only 1 CPU).
21-
bool in_rt = false;
26+
// If this library is compiled with GCC 3.3 or later in_rt will have
27+
// thread-local storage, which means that it should work on SMP machines and
28+
// with multiple clients in the same process.
29+
//
30+
// If this library is built using another compiler it will NOT have
31+
// thread-local storage, thus introducing the limitation that jack_interposer
32+
// is only usable on single-CPU machines (or machines configured to run the
33+
// application under test on only 1 CPU).
34+
bool THREAD_LOCAL in_rt = false;
2235

2336
#include "checkers.c"
2437
#include "manual.c"

0 commit comments

Comments
 (0)