diff options
author | machty <machty@gmail.com> | 2022-01-16 10:44:41 -0400 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2022-05-28 15:44:18 +1200 |
commit | 585e97142d4df1e27633afaf98ba589512215c58 (patch) | |
tree | 478a60a60b7076b4508ef6b518a7b62312d95d07 /io.c | |
parent | 216593f59b49fc7f59ed991ae3feaa1ad233ce75 (diff) | |
download | ruby-585e97142d4df1e27633afaf98ba589512215c58.tar.gz |
Always allocate write_lock
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1695,6 +1695,9 @@ io_allocate_write_buffer(rb_io_t *fptr, int sync) fptr->wbuf.len = 0; fptr->wbuf.capa = IO_WBUF_CAPA_MIN; fptr->wbuf.ptr = ALLOC_N(char, fptr->wbuf.capa); + } + + if (!fptr->write_lock) { fptr->write_lock = rb_mutex_new(); rb_mutex_allow_trap(fptr->write_lock, 1); } |