Open hwray opened 10 years ago
I implemented the lock solution in the DBHandler that we previously discussed and tested it by accepting requests on the master from two clients one after another as quickly as possible. It seemed to work well -- I watched as one phone loaded just the music from the master and then the other phone loaded the music from the first two and finally the first phone got the forwarded music from the second.
https://github.com/JayThomason/Tutti/commit/9574b677c6726d8214118d9378d03a1dd5aefa57
I'm going to reopen this for now. It looks like the solution of synchronizing the DB loader methods is causing our UI to freeze up for pretty long periods when new Clients join the jam. We may have to come up with another solution.
Right now, we aren't waiting on any of our threads that load music into the library. These include:
We need to make sure of several things:
I talked with @JayThomason and we decided these things can probably be easily solved with an exclusive loaderLock that wraps around the relevant code blocks.