On 2 December 2010 14:14, Steven McCoy <steven.mc...@miru.hk> wrote:

> Disable optimisation for encoder.cpp and it works as expected.
>
>
Alternative is a memory barrier before the re-init of in_progress.

bool zmq::encoder_t::message_ready ()
{
LONG volatile target = 0;
    //  Destroy content of the old message.
    zmq_msg_close (&in_progress);

    //  Read new message. If there is none, return false.
    //  Note that new state is set only if write is successful. That way
    //  unsuccessful write will cause retry on the next state machine
    //  invocation.
    if (!source || !source->read (&in_progress)) {
InterlockedExchange (&target, 1);
        zmq_msg_init (&in_progress);
//puts ("no new message");
        return false;
    }

-- 
Steve-o
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to