Displaying 1 result from an estimated 1 matches for "queuemutex".
2004 Jul 22
0
Re: FXRuby and Threads (was: radiobuttons are weird in 1.2.x series)
...y with being an FXRuby application.
In the client we have:
Read thread created when client connects to the server:
@sock = TCPSocket.new(host, PORT)
Thread.new do
loop do
# Queues up messages until they can be handled by client
message = @sock.readMsg
@queueMutex.synchronize {
@messageQueue.push message
}
end
end
During the FXRuby chore the queue is checked and a single message is processed, if available:
def nextMessage
# Pull off the first message (if there is one)
if @queueMutex.try_lock
message = @messa...