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

ruby-changes:40098

From: kosaki <ko1@a...>
Date: Sun, 18 Oct 2015 14:42:13 +0900 (JST)
Subject: [ruby-changes:40098] kosaki:r52179 (trunk): * random.c (fill_random_bytes_syscall): use ATOMIC_SET() for

kosaki	2015-10-18 14:42:08 +0900 (Sun, 18 Oct 2015)

  New Revision: 52179

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52179

  Log:
    * random.c (fill_random_bytes_syscall): use ATOMIC_SET() for
      updating try_syscall.

  Modified files:
    trunk/ChangeLog
    trunk/random.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52178)
+++ ChangeLog	(revision 52179)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Oct 18 13:24:17 2015  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* random.c (fill_random_bytes_syscall): use ATOMIC_SET() for
+	  updating try_syscall.
+
 Sun Oct 18 13:03:52 2015  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* include/ruby/backward/util.h: Good-by Borland-C.
Index: random.c
===================================================================
--- random.c	(revision 52178)
+++ random.c	(revision 52179)
@@ -531,7 +531,7 @@ fill_random_bytes_syscall(void *seed, si https://github.com/ruby/ruby/blob/trunk/random.c#L531
 	errno = 0;
 	ret = syscall(SYS_getrandom, seed, size, GRND_NONBLOCK);
 	if (errno == ENOSYS) {
-	    try_syscall = 0;
+	    ATOMIC_SET(try_syscall, 0);
 	    return -1;
 	}
 	if ((size_t)ret == size) return 0;

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

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