23 #ifndef TESSERACT_VIEWER_SVUTIL_H_ 24 #define TESSERACT_VIEWER_SVUTIL_H_ 30 #include <semaphore.h> 39 static void StartThread(
void *(*func)(
void*),
void* arg);
43 static void StartProcess(
const char* executable,
const char* args);
59 #elif defined(__APPLE__) 80 pthread_mutex_t mutex_;
102 SVNetwork(
const char* hostname,
int port);
108 void Send(
const char* msg);
126 char* msg_buffer_in_;
129 std::string msg_buffer_out_;
136 #endif // TESSERACT_VIEWER_SVUTIL_H_
void Lock()
Locks on a mutex.
void Unlock()
Unlocks on a mutex.
void Signal()
Signal a semaphore.
SVAutoLock(SVMutex *mutex)
void Flush()
Flush the buffer.
static void StartThread(void *(*func)(void *), void *arg)
Create new thread.
SVSemaphore()
Sets up a semaphore.
static void StartProcess(const char *executable, const char *args)
Starts a new process.
void Wait()
Wait on a semaphore.
SVMutex()
Sets up a new mutex.
static void ExitThread()
Signals a thread to exit.
void Close()
Close the connection to the server.
The SVSync class provides functionality for Thread & Process Creation.
SVNetwork(const char *hostname, int port)
Set up a connection to hostname on port.
void Send(const char *msg)
Put a message in the messagebuffer to the server and try to send it.