aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_drv_thread.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2011-03-02 14:23:22 +0100
committerPatrik Nyblom <[email protected]>2011-03-02 14:23:22 +0100
commitc971c489dc8318ca4e92e9ba40d739dc4ee50982 (patch)
treefed367a9d7eefc3201b1d23cdbb21744fa49e4ca /erts/emulator/beam/erl_drv_thread.c
parente12038dc74b081e6b5dfd2b3f266dc01a09ed523 (diff)
downloadotp-c971c489dc8318ca4e92e9ba40d739dc4ee50982.tar.gz
otp-c971c489dc8318ca4e92e9ba40d739dc4ee50982.tar.bz2
otp-c971c489dc8318ca4e92e9ba40d739dc4ee50982.zip
Remove race in main thread stealing due to reading and writing to pipe from same thread
Diffstat (limited to 'erts/emulator/beam/erl_drv_thread.c')
-rw-r--r--erts/emulator/beam/erl_drv_thread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_drv_thread.c b/erts/emulator/beam/erl_drv_thread.c
index 08a35387f2..39bbe9633b 100644
--- a/erts/emulator/beam/erl_drv_thread.c
+++ b/erts/emulator/beam/erl_drv_thread.c
@@ -698,6 +698,7 @@ erl_drv_thread_join(ErlDrvTid tid, void **respp)
#if defined(__DARWIN__) && defined(USE_THREADS) && defined(ERTS_SMP)
extern int erts_darwin_main_thread_pipe[2];
+extern int erts_darwin_main_thread_result_pipe[2];
int
@@ -709,7 +710,7 @@ erl_drv_stolen_main_thread_join(ErlDrvTid tid, void **respp)
x = &dummy;
else
x = respp;
- read(erts_darwin_main_thread_pipe[0],x,sizeof(void *));
+ read(erts_darwin_main_thread_result_pipe[0],x,sizeof(void *));
return 0;
}