summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-11-28 20:47:04 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2013-11-28 20:47:04 +0100
commit7dfe0285dd99eb02ab9b3ceff03911159e3e8ce4 (patch)
treefb5c88c4f0fce08edcfa626c5fd8ccae058515fe /src
parent92d111cf25855a41beedb2c55bc422b419e9be13 (diff)
Fix 64bit compile warning.
Diffstat (limited to 'src')
-rw-r--r--src/drumkitloader.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/drumkitloader.cc b/src/drumkitloader.cc
index a2e1923..eae9848 100644
--- a/src/drumkitloader.cc
+++ b/src/drumkitloader.cc
@@ -34,8 +34,8 @@
DrumKitLoader::DrumKitLoader()
: semaphore("drumkitloader")
{
- running = true;
run();
+ run_semaphore.wait(); // Wait for the thread to actually start.
}
DrumKitLoader::~DrumKitLoader()
@@ -107,13 +107,17 @@ void DrumKitLoader::loadKit(DrumKit *kit)
loaded = 0; // For UI Progress Messages
DEBUG(loader, "Queued %d (size: %d) AudioFiles for loading.\n",
- total_num_audiofiles, load_queue.size());
+ (int)total_num_audiofiles, (int)load_queue.size());
semaphore.post(); // Start loader loop.
}
void DrumKitLoader::thread_main()
{
+ running = true;
+
+ run_semaphore.post(); // Signal that the thread has been started.
+
while(running) {
size_t size;
{
@@ -122,11 +126,7 @@ void DrumKitLoader::thread_main()
}
// Only sleep if queue is empty.
- if(size == 0) {
- //DEBUG(loader, "Wait for sem");
- semaphore.wait();
- //DEBUG(loader, "Sem enter");
- }
+ if(size == 0) semaphore.wait();
AudioFile *audiofile = NULL;