Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ Release notes
* Updated the msgpack dependency (by :user:`Jerome Kelleher <jeromekelleher>`;
:issue:`74`, :issue:`75`).

* Allow :class:`Blosc` compressor to run on systems where locks are not present (by
:user:`Marcus Kinsella <mckinsel>`; :issue:`#83`).

* Drop Python 3.4 (by :user:`John Kirkham <jakirkham>`; :issue:`89`).


.. _release_0.5.5:

0.5.5
Expand Down
10 changes: 8 additions & 2 deletions numcodecs/blosc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ AUTOSHUFFLE = -1
AUTOBLOCKS = 0

# synchronization
mutex = multiprocessing.Lock()

try:
mutex = multiprocessing.Lock()
except OSError:
mutex = None

# store ID of process that first loads the module, so we can detect a fork later
_importer_pid = os.getpid()
Expand Down Expand Up @@ -405,6 +407,10 @@ def _get_use_threads():
global use_threads
proc = multiprocessing.current_process()

# check if locks are available, and if not no threads
if not mutex:
return False

# check for fork
if proc.pid != _importer_pid:
# If this module has been imported in the parent process, and the current process
Expand Down