Merge lp:~alecu/ubuntuone-client/make-it-stop into lp:ubuntuone-client

Proposed by Alejandro J. Cura
Status: Merged
Approved by: Roberto Alsina
Approved revision: 1127
Merged at revision: 1129
Proposed branch: lp:~alecu/ubuntuone-client/make-it-stop
Merge into: lp:ubuntuone-client
Diff against target: 27 lines (+6/-0)
2 files modified
tests/platform/windows/test_ipc.py (+5/-0)
ubuntuone/platform/windows/ipc.py (+1/-0)
To merge this branch: bzr merge lp:~alecu/ubuntuone-client/make-it-stop
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+74279@code.launchpad.net

Commit message

Set the NetworkManager thread to be a daemon thread (LP: #839638)

Description of the change

Set the NetworkManager thread to be a daemon thread (LP: #839638)

To post a comment you must log in.
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1!

review: Approve
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/platform/windows/test_ipc.py'
2--- tests/platform/windows/test_ipc.py 2011-09-02 15:01:10 +0000
3+++ tests/platform/windows/test_ipc.py 2011-09-06 18:52:58 +0000
4@@ -3495,6 +3495,11 @@
5 token = self.ipc.main.event_q.pushed_events[0][1]["access_token"]
6 self.assertEqual(token, expected_token)
7
8+ def test_daemonized(self):
9+ """Check that the NM thread won't block the process."""
10+ self.assertTrue(self.ipc.network_manager_thread.daemon)
11+
12+
13 class IPCInterfaceEmptyCredentialsTestCase(IPCInterfaceTestCaseBase):
14 """Tests for the IPCInterface with empty credentials."""
15
16
17=== modified file 'ubuntuone/platform/windows/ipc.py'
18--- ubuntuone/platform/windows/ipc.py 2011-09-02 14:48:35 +0000
19+++ ubuntuone/platform/windows/ipc.py 2011-09-06 18:52:58 +0000
20@@ -1076,6 +1076,7 @@
21 disconnected_cb=self.network_disconnected)
22 self.network_manager_thread = Thread(
23 target=self.network_manager.register, name='Network changes')
24+ self.network_manager_thread.daemon = True
25 self.network_manager_thread.start()
26
27 self.oauth_credentials = None

Subscribers

People subscribed via source and target branches