This should fix https://sourceforge.net/tracker/index.php?func=detail&aid=3187007&group_id=178178&atid=884191
There is a race condition in the opening function - mutex_lock should be called before the check for device being already opened.
Attach patch - made to tag 2.1.0 - but it should be applied to trunk as well. Also, the test program.
(note - due do my distro + another patch to the source - I manually edited the patch file. Hope it can still be applied automatically, by 'patch')
patch to fix device open() race conditions and computer freeze
program to compile and run to replicate problem