Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jni: Allow other threads to call setLogLevel()
It is useful to allow the user to toggle PRG_TRACE logging on an active connection for debugging purposes. But currently this would involve releasing the class lock held by the mainloop. So we will use asyncLock to protect the shared variable. Timings conducted on a Nexus 7 (2012) show that the new MonitorEnter/MonitorExit pair adds about 700ns to each progress_cb (which is called on each packet). This isn't great, but it's probably small enough to make it worth doing things the right way (using a lock) instead of just declaring loglevel as volatile. Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
- Loading branch information