aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-01-03 19:07:25 +0000
committerNick Mathewson <nickm@torproject.org>2005-01-03 19:07:25 +0000
commitb50263f740e601654ef8cd417d6189dd07bb27d6 (patch)
treeee55c048d5307d1333bcfe91197667cd04e46286 /src/common
parent15543a623ff13e19ae9566a5507566b7c4f0d6fb (diff)
downloadtor-b50263f740e601654ef8cd417d6189dd07bb27d6.tar
tor-b50263f740e601654ef8cd417d6189dd07bb27d6.tar.gz
More work on task #43: fix race conditions on multithreaded (win32) servers.
svn:r3251
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index b2be40312..e9f0b2337 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -331,6 +331,7 @@ tor_socketpair(int family, int type, int protocol, int fd[2])
}
fd[0] = connector;
fd[1] = acceptor;
+
return 0;
abort_tidy_up_and_fail:
@@ -557,6 +558,11 @@ get_uname(void)
/** 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.
+ *
+ * NOTE: if <b>data</b> is used, it should not be allocated on the stack,
+ * since in a multithreaded environment, there is no way to be sure that
+ * the caller's stack will still be around when the called function is
+ * running.
*/
int
spawn_func(int (*func)(void *), void *data)