mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-02 00:40:11 +01:00
- fix a race the device objects refcount during creation of the worker thread.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1603 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
efb46cb8c4
commit
4e97221b9b
1 changed files with 3 additions and 1 deletions
|
|
@ -212,9 +212,11 @@ nm_device_new (const char *iface,
|
|||
if (NM_DEVICE_GET_CLASS (dev)->init)
|
||||
NM_DEVICE_GET_CLASS (dev)->init (dev);
|
||||
|
||||
/* This ref should logically go in nm_device_worker, but we need the
|
||||
ref to be taken before the worker thread is scheduled on a cpu. */
|
||||
g_object_ref (G_OBJECT (dev));
|
||||
dev->priv->worker = g_thread_create (nm_device_worker, dev, TRUE, NULL);
|
||||
g_assert (dev->priv->worker);
|
||||
g_object_ref (G_OBJECT (dev)); /* For the worker thread */
|
||||
|
||||
/* Block until our device thread has actually had a chance to start. */
|
||||
args[0] = &dev->priv->worker_started;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue