Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
f2e350a7
Commit
f2e350a7
authored
Jul 24, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more pessimistic locking for ConnectionManagerFS
parent
359377ac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
fs/remote.py
+5
-2
No files found.
fs/remote.py
View file @
f2e350a7
...
@@ -195,12 +195,14 @@ class ConnectionManagerFS(WrapFS):
...
@@ -195,12 +195,14 @@ class ConnectionManagerFS(WrapFS):
def
wait_for_connection
(
self
,
timeout
=
None
):
def
wait_for_connection
(
self
,
timeout
=
None
):
self
.
_connection_cond
.
acquire
()
self
.
_connection_cond
.
acquire
()
try
:
if
not
self
.
connected
:
if
not
self
.
connected
:
if
not
self
.
_poll_thread
:
if
not
self
.
_poll_thread
:
target
=
self
.
_poll_connection
target
=
self
.
_poll_connection
self
.
_poll_thread
=
threading
.
Thread
(
target
=
target
)
self
.
_poll_thread
=
threading
.
Thread
(
target
=
target
)
self
.
_poll_thread
.
start
()
self
.
_poll_thread
.
start
()
self
.
_connection_cond
.
wait
(
timeout
)
self
.
_connection_cond
.
wait
(
timeout
)
finally
:
self
.
_connection_cond
.
release
()
self
.
_connection_cond
.
release
()
def
_poll_connection
(
self
):
def
_poll_connection
(
self
):
...
@@ -210,15 +212,16 @@ class ConnectionManagerFS(WrapFS):
...
@@ -210,15 +212,16 @@ class ConnectionManagerFS(WrapFS):
except
RemoteConnectionError
:
except
RemoteConnectionError
:
self
.
_poll_sleeper
.
wait
(
self
.
poll_interval
)
self
.
_poll_sleeper
.
wait
(
self
.
poll_interval
)
self
.
_poll_sleeper
.
clear
()
self
.
_poll_sleeper
.
clear
()
continue
except
FSError
:
except
FSError
:
break
break
else
:
else
:
break
break
self
.
_connection_cond
.
acquire
()
self
.
_connection_cond
.
acquire
()
try
:
self
.
connected
=
True
self
.
connected
=
True
self
.
_poll_thread
=
None
self
.
_poll_thread
=
None
self
.
_connection_cond
.
notifyAll
()
self
.
_connection_cond
.
notifyAll
()
finally
:
self
.
_connection_cond
.
release
()
self
.
_connection_cond
.
release
()
def
close
(
self
):
def
close
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment