Created
May 23, 2012 14:04
-
-
Save kui/2775406 to your computer and use it in GitHub Desktop.
別スレッドで select 呼んで、メインスレッドで uinput に書き込みをしようとするとブロックされたままになってしまう現象の再現コード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8; mode:ruby; -*- | |
t = Thread.new do | |
select nil, nil, nil, 1 | |
puts 'timeout select(2)' | |
end | |
open '/dev/uinput', 'w' do |f| | |
f.syswrite 'foo' # block | |
end | |
t.join |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
syswrite
→write
にすると問題ない