mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 981239: Use atomic ref-counting for |UnixSocketConsumer|, r=kyle
|SocketSendTask| acquires a reference to |UnixSocketConsumer| on the main thread and releases this reference on the I/O thread; leading to race-conditions. This patch adds - atomicity for ref-counting of |UnixSocketConsumer|, and - stricter tests in the destructor of this class.
This commit is contained in:
parent
b38304a595
commit
88cf1c0e54
@ -739,6 +739,8 @@ UnixSocketConsumer::UnixSocketConsumer() : mImpl(nullptr)
|
||||
|
||||
UnixSocketConsumer::~UnixSocketConsumer()
|
||||
{
|
||||
MOZ_ASSERT(mConnectionStatus == SOCKET_DISCONNECTED);
|
||||
MOZ_ASSERT(!mImpl);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -135,7 +135,7 @@ enum SocketConnectionStatus {
|
||||
SOCKET_CONNECTED = 3
|
||||
};
|
||||
|
||||
class UnixSocketConsumer : public RefCounted<UnixSocketConsumer>
|
||||
class UnixSocketConsumer : public AtomicRefCounted<UnixSocketConsumer>
|
||||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(UnixSocketConsumer)
|
||||
|
Loading…
Reference in New Issue
Block a user