Issue #7455 has been updated by kosaki (Motohiro KOSAKI).


????????????????????????吾???????????

1. que.pop??с??mutex.sleep?????若?違?????腟?絮?sleep_forever()?????若?違????????????????т????? status = THREAD_STOPPED_FOREVER?????
2. Process.kill ???????????? status = THREAD_RUNNABLE???????????????????潟??????絎?茵???????????
3. que.push ?????若?吟?????main thread??????с?? thread runnable????т?????????????????
4. ??泣????鴻??????罩祉??
5. trap??????????????????? rb_threadptr_execute_interrupt()?????? th->status = prev_status; ???????????c???
   status???THREAD_STOPPED_FOREVER???祉??
6.sleep_forever() ??? status != THREAD_RUNNABLE ???翫??sleep??????絎?茵??????????с??????????с??????????????????с?????
   ????罧???c????????鴻????????с???????<?ゃ?潟?鴻????????? THREAD_STOPPED_FOREVER????с???????с?????????с??????蚊?c????????綣桁?句??篋?

??????????????????????????????



----------------------------------------
Bug #7455: Queue#pop??у????c????????????trap???ャ????????????Queue#push?????????????Queue#pop????????祉?c?????????????
https://bugs.ruby-lang.org/issues/7455#change-34084

Author: tarui (Masaya Tarui)
Status: Assigned
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-28 trunk 37937) [x86_64-linux]


篁ヤ????鴻??????????絎?茵???????????緇?????????????????????????????deadlock?????????障????障?????
?????????????????????????????
--

require 'thread'

que = Queue.new
th = Thread.new{
  sleep 0.1 
  Process.kill(:INT,$$)
  sleep 0.1 
  que.push 2
}
Signal.trap :INT do
  p :trap_task
  123456**100000 / 456 ** 10000
  p :trap_task_end
end
puts "que.pop"
p que.pop
puts "success!"



-- 
http://bugs.ruby-lang.org/