mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-14 23:07:59 +02:00
Set and arrange propagation of thread safe sockets flag.
We use a distinct context initialisation function to specify all sockets derived therefrom will be thread safe. However the inheritance is done exclusively in the C interface. This is not really correct, but it is chosen to minimise interference with the existing C++ code, including any construct or other calls within the C++ code base. Semantically the C++ code should be unchanged, physically some data structures and extra methods are provided by they're only used from the C binding.
This commit is contained in:
@@ -874,6 +874,11 @@ void zmq::socket_base_t::extract_flags (msg_t *msg_)
|
||||
rcvmore = msg_->flags () & msg_t::more ? true : false;
|
||||
}
|
||||
|
||||
void zmq::socket_base_t::set_thread_safe()
|
||||
{
|
||||
thread_safe_flag = true;
|
||||
}
|
||||
|
||||
void zmq::socket_base_t::lock()
|
||||
{
|
||||
sync.lock();
|
||||
|
Reference in New Issue
Block a user