multithreading - Qt slot simultaneous disconnect and call from different theads -


i'm newbie qt. haven't found answer in reasonable time , decided ask here.

i have thread, let's call thread1 qt object have connected slot. signal emitted same thread (thread1). , i'm disconnecting slot thread2.

is operation thread safe? there problems, if signal emitted , slot disconnected @ same time?

just looking @ docs, looks safe me:

http://qt-project.org/doc/qt-4.8/qobject.html

note: functions in class reentrant, connect(), connect(), disconnect(), , disconnect() thread-safe.

http://qt-project.org/doc/qt-4.8/qobject.html#disconnect

note: function thread-safe.

also make sure using queued connections when connecting signal of 1 thread slot of another. auto-connect may misbehave (and direct connection) if both objects happen in same thread during time of connection.

hope helps.

edit: more thread safety:

http://qt-project.org/doc/qt-4.8/threads-reentrancy.html

http://qt-project.org/doc/qt-4.8/threads-qobject.html


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -