2 ms·
I don't know much about these file descriptors but in this case I would protect it using ReentrantLock or Monitor from Guava https://docs.oracle.com/javase/7/d
by agilob 4y ago
I don't know much about these file descriptors but in this case I would protect it using ReentrantLock or Monitor from Guava
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantLock.html https://docs.oracle.com/javase/7/docs/api/java/util/concurre...
They are more powerful than synchronized and can produce log messages when things go sideways with locking, dead locking or external crashes.