I ran into a race condition in zmq::socket_t::close() in cppzmq:

*inline void *close() ZMQ_NOTHROW
{
    *if*(ptr == NULL)

*// already closed        **return *;

*// Someone can sneak in here and close the socket*
    *int *rc = zmq_close (ptr);
    ZMQ_ASSERT (rc == 0);
    ptr = 0 ;
}

I worked around it using compare-and-swap to atomically check if it's
already closed. Does that kind of fix sound reasonable for
zmq::socket_t::close()?


Also I wanted to follow up on my previous question about tagging cppzmq.  I
think that conversation got lost in the list shutdown that happened
recently.  Does it make sense to regularly tag the cppzmq repo with the
corresponding ZeroMQ version?

Thanks,

-- Eric
_______________________________________________
zeromq-dev mailing list
[email protected]
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to