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;
61 static int fClientCount;
67 if (!JackMessageBuffer::Create()) {
80 sigemptyset(&signals);
81 sigaddset(&signals, SIGPIPE);
89 for (
int i = 0; i < CLIENT_NUM; i++) {
92 JackMessageBuffer::Destroy();
107 if (!JackGlobals::fServerRunning && fClientCount > 0) {
110 jack_error(
"Jack server was closed but clients are still allocated, cleanup...");
111 for (
int i = 0; i < CLIENT_NUM; i++) {
112 JackClient* client = JackGlobals::fClientTable[i];
126 if (fClientCount++ == 0 && !fGlobals) {
127 jack_log(
"JackLibGlobals Init %x", fGlobals);
129 fGlobals =
new JackLibGlobals();
133 static void Destroy()
135 if (--fClientCount == 0 && fGlobals) {
136 jack_log(
"JackLibGlobals Destroy %x", fGlobals);
Inter process synchronization using POSIX 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]