10.3.1 Message queues
AllApplicationManualNameSummaryHelp

  • 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
            • thread_get_message/2
            • thread_get_message/3
            • thread_peek_message/2
            • message_queue_property/2
    • Packages
Availability:built-in
thread_get_message(?Term)
Examines the thread message queue and if necessary blocks execution until a term that unifies to Term arrives in the queue. After a term from the queue has been unified to Term, the term is deleted from the queue.

Please note that non-unifying messages remain in the queue. After the following has been executed, thread 1 has the term b(gnu) in its queue and continues execution using A = gnat.

   <thread 1>
   thread_get_message(a(A)),

   <thread 2>
   thread_send_message(Thread_1, b(gnu)),
   thread_send_message(Thread_1, a(gnat)),

See also thread_peek_message/1.