10.3.1 Message queues
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Multithreaded applications
        • Thread communication
          • Message queues
            • thread_send_message/2
            • thread_send_message/3
            • thread_get_message/1
            • thread_peek_message/1
            • message_queue_create/1
            • message_queue_create/2
            • message_queue_destroy/1
            • is_message_queue/1
            • thread_get_message/2
            • thread_get_message/3
            • thread_peek_message/2
            • message_queue_property/2
            • message_queue_set/2
    • Packages
Availability:built-in
[semidet]thread_get_message(+Queue, ?Term, +Options)
As thread_get_message/2, but providing additional Options:
deadline(+AbsTime)
The call fails (silently) if no message has arrived before AbsTime. See get_time/1 for the representation of absolute time. If AbsTime is earlier then the current time, thread_get_message/3 fails immediately. Both resolution and maximum wait time is platform-dependent.205The implementation uses MsgWaitForMultipleObjects() on MS-Windows and pthread_cond_timedwait() on other systems.
timeout(+Time)
Time is a float or integer and specifies the maximum time to wait in seconds. This is a relative-time version of the deadline option. If both options are provided, the earlier time is effective.

If Time is 0 or 0.0, thread_get_message/3 examines the queue but does not suspend if no matching term is available. Note that unlike thread_peek_message/2, a matching term is removed from the queue.

If Time < 0, thread_get_message/3 fails immediately without removing any message from the queue.

signals(+BoolOrTime)
Whether or not signals (see thread_signal/2) are processed while waiting. As the underlying implementation does not handle signals on most platforms, the implementation by default (true) times out every 0.25 seconds and checks for signals. If false, signals are not checked. If a number is specified, we check for signals every Time seconds. Smaller times may be used to improved responsiveness to signals. Larger times may be used to reduce CPU usage.