diff options
author | Rickard Green <[email protected]> | 2011-10-30 00:23:16 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2011-11-13 20:40:59 +0100 |
commit | 15774d2ac5ba38dba287309f91eb7e4f58b9a636 (patch) | |
tree | ff9f7f07f0d5c2b807c1614fb2f44b31f505d672 /erts/emulator/beam/erl_drv_thread.c | |
parent | dcc7ecbf6af5420af2d5dbd0e97fc7a2e0e894a6 (diff) | |
download | otp-15774d2ac5ba38dba287309f91eb7e4f58b9a636.tar.gz otp-15774d2ac5ba38dba287309f91eb7e4f58b9a636.tar.bz2 otp-15774d2ac5ba38dba287309f91eb7e4f58b9a636.zip |
Use critical sections as mutex implementation on Windows
Windows native critical sections are now used internally in the
runtime system as mutex implementation. This since they perform
better under extreme contention than our own implementation.
Diffstat (limited to 'erts/emulator/beam/erl_drv_thread.c')
-rw-r--r-- | erts/emulator/beam/erl_drv_thread.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_drv_thread.c b/erts/emulator/beam/erl_drv_thread.c index dc578f6d2a..a49a155701 100644 --- a/erts/emulator/beam/erl_drv_thread.c +++ b/erts/emulator/beam/erl_drv_thread.c @@ -158,7 +158,9 @@ erl_drv_mutex_create(char *name) (sizeof(ErlDrvMutex) + (name ? sys_strlen(name) + 1 : 0))); if (dmtx) { - if (ethr_mutex_init(&dmtx->mtx) != 0) { + ethr_mutex_opt opt = ETHR_MUTEX_OPT_DEFAULT_INITER; + opt.posix_compliant = 1; + if (ethr_mutex_init_opt(&dmtx->mtx, &opt) != 0) { erts_free(ERTS_ALC_T_DRV_MTX, (void *) dmtx); dmtx = NULL; } @@ -226,7 +228,9 @@ erl_drv_cond_create(char *name) (sizeof(ErlDrvCond) + (name ? sys_strlen(name) + 1 : 0))); if (dcnd) { - if (ethr_cond_init(&dcnd->cnd) != 0) { + ethr_cond_opt opt = ETHR_COND_OPT_DEFAULT_INITER; + opt.posix_compliant = 1; + if (ethr_cond_init_opt(&dcnd->cnd, &opt) != 0) { erts_free(ERTS_ALC_T_DRV_CND, (void *) dcnd); dcnd = NULL; } |