Returns true
if this process is stopped. This is only returned if the corresponding wait call had the Process::WUNTRACED flag set.
Returns the number of the signal that caused stat to stop (or nil
if self is not stopped).
Returns the number of the signal that caused stat to terminate (or nil
if self was not terminated by an uncaught signal).
Obtains a lock, runs the block, and releases the lock when the block completes. See the example under Thread::Mutex
.
Closes the queue. A closed queue cannot be re-opened.
After the call to close completes, the following are true:
closed?
will return true
close
will be ignored.
calling enq/push/<< will raise a ClosedQueueError
.
when empty?
is false, calling deq/pop/shift will return an object from the queue as usual.
when empty?
is true, deq(false) will not suspend the thread and will return nil. deq(true) will raise a ThreadError
.
ClosedQueueError
is inherited from StopIteration
, so that you can break loop block.
Example:
q = Thread::Queue.new Thread.new{ while e = q.deq # wait for nil to break loop # ... end } q.close
Returns true
if the queue is closed.
Retrieves data from the queue.
If the queue is empty, the calling thread is suspended until data is pushed onto the queue. If non_block
is true, the thread isn’t suspended, and ThreadError
is raised.
Returns true
if the queue is empty.
Removes all objects from the queue.
Similar to Thread::Queue#close
.
The difference is behavior with waiting enqueuing threads.
If there are waiting enqueuing threads, they are interrupted by raising ClosedQueueError(‘queue closed’).
Retrieves data from the queue.
If the queue is empty, the calling thread is suspended until data is pushed onto the queue. If non_block
is true, the thread isn’t suspended, and ThreadError
is raised.
Returns true
if the queue is empty.
Removes all objects from the queue.
Returns URL-escaped string following RFC 3986.
Returns URL-unescaped string following RFC 3986.
URL-encode a string following RFC 3986 Space characters (+“ ”+) are encoded with (+“%20”+)
url_encoded_string = CGI.escape("'Stop!' said Fred") # => "%27Stop%21%27%20said%20Fred"
URL-decode a string following RFC 3986 with encoding(optional).
string = CGI.unescape("%27Stop%21%27+said%20Fred") # => "'Stop!'+said Fred"
Resets the digest to the initial state and returns self.
This method is overridden by each implementation subclass.
If none is given, returns the resulting hash value of the digest in a base64 encoded form, keeping the digest’s state.
If a string
is given, returns the hash value for the given string
in a base64 encoded form, resetting the digest to the initial state before and after the process.
In either case, the return value is properly padded with ‘=’ and contains no line feeds.
Returns the resulting hash value and resets the digest to the initial state.
Creates a global method from the given C signature
.
The Fiddle::CompositeHandler
instance
Will raise an error if no handlers are open.