20 #ifndef __JackLibGlobals__
21 #define __JackLibGlobals__
23 #include "JackShmMem.h"
24 #include "JackEngineControl.h"
25 #include "JackGlobals.h"
26 #include "JackPlatformPlug.h"
27 #include "JackGraphManager.h"
28 #include "JackMessageBuffer.h"
30 #include "JackClient.h"
31 #include "JackError.h"
37 #include <sys/types.h>
38 typedef _sigset_t sigset_t;
40 typedef HANDLE sigset_t;
60 static int fClientCount;
66 if (!JackMessageBuffer::Create()) {
77 sigemptyset(&signals);
78 sigaddset(&signals, SIGPIPE);
86 for (
int i = 0; i < CLIENT_NUM; i++) {
89 JackMessageBuffer::Destroy();
101 if (!JackGlobals::fServerRunning && fClientCount > 0) {
104 jack_error(
"Jack server was closed but clients are still allocated, cleanup...");
105 for (
int i = 0; i < CLIENT_NUM; i++) {
106 JackClient* client = JackGlobals::fClientTable[i];
111 JackGlobals::fClientTable[CLIENT_NUM] = NULL;
121 if (fClientCount++ == 0 && !fGlobals) {
122 jack_log(
"JackLibGlobals Init %x", fGlobals);
124 fGlobals =
new JackLibGlobals();
128 static void Destroy()
130 if (--fClientCount == 0 && fGlobals) {
131 jack_log(
"JackLibGlobals Destroy %x", fGlobals);
Inter process synchronization using using Mach semaphore.
SERVER_EXPORT void jack_error(const char *fmt,...)
Global library static structure: singleton kind of pattern.
Pointer on shared memory segment in the client side.
JackShmReadWritePtr< JackEngineControl > fEngineControl
SERVER_EXPORT void jack_log(const char *fmt,...)
JackSynchro fSynchroTable[CLIENT_NUM]