diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-08-12 07:01:20 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-08-12 07:01:20 +0000 |
commit | e4a6ea5c464afbd03ef32c3d060185bf8c770d1e (patch) | |
tree | 7c0d393ff88bd886d8c2e913a5172d831eac49cd /src/common/util.h | |
parent | 5c4255595d571dd688d666fe86a34c8f418ef1d3 (diff) | |
download | tor-e4a6ea5c464afbd03ef32c3d060185bf8c770d1e.tar tor-e4a6ea5c464afbd03ef32c3d060185bf8c770d1e.tar.gz |
Add abstraction for fork vs thread.
svn:r387
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index eb175c961..ee3c6eba4 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -45,4 +45,11 @@ int tv_cmp(struct timeval *a, struct timeval *b); void set_socket_nonblocking(int socket); +/* Minimalist interface to run a void function in the background. On + unix calls fork, on win32 calls beginthread. Returns -1 on failure. + func should not return, but rather should call spawn_exit. +*/ +int spawn_func(int (*func)(void *), void *data); +void spawn_exit(); + #endif |