I have seen other applications using flock on their open hidraw file descriptors to open them exclusively. This is not the default for hidapi but I am not asking for this to change. I was thinking it might be a good idea to use flock to acquire a shared lock so hidapi applications won't conflict with other applications using flock with an exclusive lock while still allowing hidraw devices to be opened concurrently with other applications that are also using a shared lock.
Would this be useful at all to implement? It's not particularly hard to do.
I have seen other applications using
flock
on their openhidraw
file descriptors to open them exclusively. This is not the default forhidapi
but I am not asking for this to change. I was thinking it might be a good idea to useflock
to acquire a shared lock sohidapi
applications won't conflict with other applications usingflock
with an exclusive lock while still allowinghidraw
devices to be opened concurrently with other applications that are also using a shared lock.Would this be useful at all to implement? It's not particularly hard to do.