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 #pragma warning(disable:4786) 41 #include <semaphore.h> 47 #define MAX(a, b) ((a > b) ? a : b) 51 #define MIN(a, b) ((a < b) ? a : b) 58 static void StartThread(
void *(*func)(
void*),
void* arg);
62 static void StartProcess(
const char* executable,
const char* args);
78 #elif defined(__APPLE__) 99 pthread_mutex_t mutex_;
121 SVNetwork(
const char* hostname,
int port);
127 void Send(
const char* msg);
145 char* msg_buffer_in_;
148 std::string msg_buffer_out_;
155 #endif // TESSERACT_VIEWER_SVUTIL_H_ static void StartThread(void *(*func)(void *), void *arg)
Create new thread.
SVAutoLock(SVMutex *mutex)
static void ExitThread()
Signals a thread to exit.
The SVSync class provides functionality for Thread & Process Creation.
void Lock()
Locks on a mutex.
static void StartProcess(const char *executable, const char *args)
Starts a new process.