Workaround apparent bug in 1.8.7/REE: block all during sem_timedwait
This commit is contained in:
parent
d3d51fef91
commit
d2f8af03eb
|
@ -28,7 +28,10 @@ module ProcessShared
|
||||||
attach_function :sem_post, [:sem_p], :int
|
attach_function :sem_post, [:sem_p], :int
|
||||||
attach_function :sem_wait, [:sem_p], :int, :blocking => true
|
attach_function :sem_wait, [:sem_p], :int, :blocking => true
|
||||||
attach_function :sem_trywait, [:sem_p], :int, :blocking => true
|
attach_function :sem_trywait, [:sem_p], :int, :blocking => true
|
||||||
attach_function :sem_timedwait, [:sem_p, TimeSpec], :int, :blocking => true
|
|
||||||
|
# Workaround bug which only appears to affect Ruby 1.8.7 and REE
|
||||||
|
BLOCKING_SEM_TIMEDWAIT = (RUBY_VERSION != '1.8.7')
|
||||||
|
attach_function :sem_timedwait, [:sem_p, TimeSpec], :int, :blocking => BLOCKING_SEM_TIMEDWAIT
|
||||||
|
|
||||||
error_check(:sem_close, :sem_unlink, :sem_init, :sem_destroy,
|
error_check(:sem_close, :sem_unlink, :sem_init, :sem_destroy,
|
||||||
:sem_getvalue, :sem_post, :sem_wait, :sem_trywait,
|
:sem_getvalue, :sem_post, :sem_wait, :sem_trywait,
|
||||||
|
|
Loading…
Reference in New Issue