aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-19 11:13:40 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-19 11:13:40 +0000
commit4b25e0ceca487725f4579d21271546e2bd0d3563 (patch)
treeefe66ab1db91d0ad2e19466566ee73de5bc3b92d
parent212150c2e148278b1a300bd823f0a3d4753cd37d (diff)
downloadruby-4b25e0ceca487725f4579d21271546e2bd0d3563.tar.gz
* thread.c (rb_threadptr_async_errinfo_active_p): added a small
comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--thread.c14
2 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f8306bfd1b..4aa364a275 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Nov 20 10:12:46 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_threadptr_async_errinfo_active_p): added a small
+ comment.
+
Tue Nov 20 10:08:45 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* thread.c, vm_core.h: big rename th to cur_th when works only
diff --git a/thread.c b/thread.c
index d21fc1a36d..38251afd56 100644
--- a/thread.c
+++ b/thread.c
@@ -1476,12 +1476,20 @@ rb_threadptr_async_errinfo_deque(rb_thread_t *th, enum interrupt_timing timing)
int
rb_threadptr_async_errinfo_active_p(rb_thread_t *th)
{
- if (th->async_errinfo_queue_checked || rb_threadptr_async_errinfo_empty_p(th)) {
+ /*
+ * For optimization, we don't check async errinfo queue
+ * if it nor a thread interrupt mask were not changed
+ * since last check.
+ */
+ if (th->async_errinfo_queue_checked) {
return 0;
}
- else {
- return 1;
+
+ if (rb_threadptr_async_errinfo_empty_p(th)) {
+ return 0;
}
+
+ return 1;
}
static VALUE