[前][次][番号順一覧][スレッド一覧]

ruby-changes:71989

From: machty <ko1@a...>
Date: Sat, 28 May 2022 12:44:47 +0900 (JST)
Subject: [ruby-changes:71989] 585e97142d (master): Always allocate write_lock

https://git.ruby-lang.org/ruby.git/commit/?id=585e97142d

From 585e97142d4df1e27633afaf98ba589512215c58 Mon Sep 17 00:00:00 2001
From: machty <machty@g...>
Date: Sun, 16 Jan 2022 10:44:41 -0400
Subject: Always allocate write_lock

---
 io.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/io.c b/io.c
index a01aca8f61..2f4d1db5f8 100644
--- a/io.c
+++ b/io.c
@@ -1695,6 +1695,9 @@ io_allocate_write_buffer(rb_io_t *fptr, int sync) https://github.com/ruby/ruby/blob/trunk/io.c#L1695
         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);
     }
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]