mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-22 18:28:39 +01:00
Removed last vestiges of thread-safe sockets
This commit is contained in:
parent
9ccfbf8d30
commit
06dd31c56a
10
src/ctx.cpp
10
src/ctx.cpp
@ -81,16 +81,6 @@ zmq::ctx_t::ctx_t (uint32_t io_threads_) :
|
|||||||
zmq_assert (rc == 0);
|
zmq_assert (rc == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void zmq::ctx_t::set_thread_safe()
|
|
||||||
{
|
|
||||||
thread_safe_flag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool zmq::ctx_t::get_thread_safe() const
|
|
||||||
{
|
|
||||||
return thread_safe_flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool zmq::ctx_t::check_tag ()
|
bool zmq::ctx_t::check_tag ()
|
||||||
{
|
{
|
||||||
return tag == 0xbadcafe0;
|
return tag == 0xbadcafe0;
|
||||||
|
@ -99,10 +99,6 @@ namespace zmq
|
|||||||
reaper_tid = 1
|
reaper_tid = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
// create thread safe sockets
|
|
||||||
void set_thread_safe();
|
|
||||||
bool get_thread_safe() const;
|
|
||||||
|
|
||||||
~ctx_t ();
|
~ctx_t ();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -155,8 +151,6 @@ namespace zmq
|
|||||||
zmq::socket_base_t *log_socket;
|
zmq::socket_base_t *log_socket;
|
||||||
mutex_t log_sync;
|
mutex_t log_sync;
|
||||||
|
|
||||||
bool thread_safe_flag;
|
|
||||||
|
|
||||||
ctx_t (const ctx_t&);
|
ctx_t (const ctx_t&);
|
||||||
const ctx_t &operator = (const ctx_t&);
|
const ctx_t &operator = (const ctx_t&);
|
||||||
};
|
};
|
||||||
|
@ -128,8 +128,7 @@ zmq::socket_base_t::socket_base_t (ctx_t *parent_, uint32_t tid_) :
|
|||||||
destroyed (false),
|
destroyed (false),
|
||||||
last_tsc (0),
|
last_tsc (0),
|
||||||
ticks (0),
|
ticks (0),
|
||||||
rcvmore (false),
|
rcvmore (false)
|
||||||
thread_safe_flag (false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -910,19 +909,3 @@ void zmq::socket_base_t::extract_flags (msg_t *msg_)
|
|||||||
// Remove MORE flag.
|
// Remove MORE flag.
|
||||||
rcvmore = msg_->flags () & msg_t::more ? true : false;
|
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
void zmq::socket_base_t::unlock()
|
|
||||||
{
|
|
||||||
sync.unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -95,8 +95,6 @@ namespace zmq
|
|||||||
void write_activated (pipe_t *pipe_);
|
void write_activated (pipe_t *pipe_);
|
||||||
void hiccuped (pipe_t *pipe_);
|
void hiccuped (pipe_t *pipe_);
|
||||||
void terminated (pipe_t *pipe_);
|
void terminated (pipe_t *pipe_);
|
||||||
bool thread_safe() const { return thread_safe_flag; }
|
|
||||||
void set_thread_safe(); // should be in constructor, here for compat
|
|
||||||
void lock();
|
void lock();
|
||||||
void unlock();
|
void unlock();
|
||||||
protected:
|
protected:
|
||||||
@ -198,7 +196,6 @@ namespace zmq
|
|||||||
|
|
||||||
socket_base_t (const socket_base_t&);
|
socket_base_t (const socket_base_t&);
|
||||||
const socket_base_t &operator = (const socket_base_t&);
|
const socket_base_t &operator = (const socket_base_t&);
|
||||||
bool thread_safe_flag;
|
|
||||||
mutex_t sync;
|
mutex_t sync;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user