The SVSync class provides functionality for Thread & Process Creation.
More...
#include <svutil.h>
The SVSync class provides functionality for Thread & Process Creation.
Definition at line 55 of file svutil.h.
void SVSync::ExitThread |
( |
| ) |
|
|
static |
Signals a thread to exit.
Definition at line 66 of file svutil.cpp.
void SVSync::StartProcess |
( |
const char * |
executable, |
|
|
const char * |
args |
|
) |
| |
|
static |
Starts a new process.
Definition at line 75 of file svutil.cpp.
77 proc.append(executable);
80 std::cout <<
"Starting " << proc << std::endl;
82 STARTUPINFO start_info;
83 PROCESS_INFORMATION proc_info;
84 GetStartupInfo(&start_info);
86 CREATE_NO_WINDOW | DETACHED_PROCESS,
NULL,
NULL,
87 &start_info, &proc_info))
96 prctl(PR_SET_PDEATHSIG, 2, 0, 0, 0);
98 char* mutable_args = strdup(args);
100 for (
int i = 0; mutable_args[i]; ++i) {
101 if (mutable_args[i] ==
' ') {
105 char** argv =
new char*[argc + 2];
106 argv[0] = strdup(executable);
107 argv[1] = mutable_args;
109 bool inquote =
false;
110 for (
int i = 0; mutable_args[i]; ++i) {
111 if (!inquote && mutable_args[i] ==
' ') {
112 mutable_args[i] =
'\0';
113 argv[argc++] = mutable_args + i + 1;
114 }
else if (mutable_args[i] ==
'"') {
116 mutable_args[i] =
' ';
120 execvp(executable, argv);
void SVSync::StartThread |
( |
void *(*)(void *) |
func, |
|
|
void * |
arg |
|
) |
| |
|
static |
Create new thread.
Definition at line 187 of file svutil.cpp.
189 LPTHREAD_START_ROUTINE f = (LPTHREAD_START_ROUTINE) func;
191 HANDLE newthread = CreateThread(
200 pthread_create(&helper,
NULL, func, arg);
The documentation for this class was generated from the following files: