24 #ifndef TESSERACT_VIEWER_SVUTIL_H_ 25 #define TESSERACT_VIEWER_SVUTIL_H_ 32 #include <semaphore.h> 38 #define MAX(a, b) ((a > b) ? a : b) 42 #define MIN(a, b) ((a < b) ? a : b) 49 static void StartThread(
void *(*func)(
void*),
void* arg);
53 static void StartProcess(
const char* executable,
const char* args);
69 #elif defined(__APPLE__) 112 SVNetwork(
const char* hostname,
int port);
118 void Send(
const char* msg);
146 #endif // TESSERACT_VIEWER_SVUTIL_H_ pthread_mutex_t mutex_
Definition: svutil.h:90
static void StartProcess(const char *executable, const char *args)
Starts a new process.
Definition: svutil.cpp:120
std::string msg_buffer_out_
Stores the messages which are supposed to go out.
Definition: svutil.h:139
static void StartThread(void *(*func)(void *), void *arg)
Create new thread.
Definition: svutil.cpp:87
The SVSync class provides functionality for Thread & Process Creation.
Definition: svutil.h:46
SVMutex mutex_send_
The mutex for access to Send() and Flush().
Definition: svutil.h:132
~SVAutoLock()
Definition: svutil.h:99
SVAutoLock(SVMutex *mutex)
Definition: svutil.h:98
bool has_content
Definition: svutil.h:141
int stream_
The actual stream_ to the server.
Definition: svutil.h:134
SVMutex * mutex_
Definition: svutil.h:102
sem_t semaphore_
Definition: svutil.h:72
void Lock()
Locks on a mutex.
Definition: svutil.cpp:70
static void ExitThread()
Signals a thread to exit.
Definition: svutil.cpp:111
char * buffer_ptr_
Where we are at in our msg_buffer_in_.
Definition: svutil.h:143
char * msg_buffer_in_
Stores the last received message-chunk from the server.
Definition: svutil.h:136