OmniThreadLibrary forum
News: SMF - Just Installed!
 
*
Welcome, Guest. Please login or register. May 17, 2012, 06:02:25 PM


Login with username, password and session length


Pages: [1]   Go Down

Author Topic: how to clear message queue of TOmniWorker  (Read 218 times)

ahwux

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
how to clear message queue of TOmniWorker
« on: January 02, 2012, 09:47:19 PM »

Hi I have a TOmniWorker object, which,  handles a few types of messages sent from its task control. 

I would like to know how can I achieve this,  that is,  if this task worker receives message MSG_CLEAR_MSG_QUEUE,  it removes all the messages currently waiting in queue after MSG_CLEAR_MSG_QUEUE.

Is this doable?

Thank you.
Logged

ahwux

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: how to clear message queue of TOmniWorker
« Reply #1 on: January 02, 2012, 09:55:58 PM »

By searching previous posts I figured out.  So I use
Task.Comm.Writer.Empty.

This should be fine since there is no associated msgData that need to be freed by the worker anyway.
Logged
Pages: [1]   Go Up
 
 

Powered by MySQL Powered by PHP Powered by SMF 2.0.2 | SMF © 2006-2009, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM