interprocess icon indicating copy to clipboard operation
interprocess copied to clipboard

`message_queue::timed_receive` block process a long duration than expect when `system time` jumb back

Open jerryhuangcc opened this issue 1 year ago • 0 comments

In my project, I use message_queue::timed_receive to handle inter process messaging.

But in issue scenario, my system clock falled back to 2mins, then timed_receive waited for more than 1s already set in code. This behaviour is not expected.

while (true)
{
     // var defination
     if (message_queue.timed_receive(&message, sizeof(message), received_size, priority, std::chrono::seconds(1))) 
    {
           handle(message); 
    }

    // other logics
   
}

My question is for message_queue::timed_receive, does it support steady_clock which is not affected by system time update?

jerryhuangcc avatar Mar 04 '24 09:03 jerryhuangcc