24 #ifndef TESSERACT_VIEWER_SVUTIL_H_ 25 #define TESSERACT_VIEWER_SVUTIL_H_ 31 #if defined(_MSC_VER) && _MSC_VER < 1900 32 #define snprintf _snprintf 34 #if (_MSC_VER <= 1400) 35 #define vsnprintf _vsnprintf 37 #pragma warning(disable:4786) 44 #include <semaphore.h> 50 #define MAX(a, b) ((a > b) ? a : b) 54 #define MIN(a, b) ((a < b) ? a : b) 61 static void StartThread(
void *(*func)(
void*),
void* arg);
65 static void StartProcess(
const char* executable,
const char* args);
81 #elif defined(__APPLE__) 102 pthread_mutex_t mutex_;
124 SVNetwork(
const char* hostname,
int port);
130 void Send(
const char* msg);
148 char* msg_buffer_in_;
151 std::string msg_buffer_out_;
158 #endif // TESSERACT_VIEWER_SVUTIL_H_ static void StartProcess(const char *executable, const char *args)
Starts a new process.
SVAutoLock(SVMutex *mutex)
static void ExitThread()
Signals a thread to exit.
The SVSync class provides functionality for Thread & Process Creation.
static void StartThread(void *(*func)(void *), void *arg)
Create new thread.
void Lock()
Locks on a mutex.