Shohei Yasutake / Mbed 2 deprecated koibumi2000

Dependencies:   fll mbed-rtos mbed

Revision:
4:9ee673ca05ad
Parent:
3:edbf31a8589f
Child:
5:130721ce29f7
--- a/fll.cpp	Sat Feb 14 06:39:14 2015 +0000
+++ b/fll.cpp	Sat Feb 14 06:49:42 2015 +0000
@@ -55,14 +55,16 @@
     mutex = mut;
 }
 
-// 何ミリ秒かごとに呼ばれる
 void Sink::run()
 {
     button_t *btn;
-    for (int i = 0; i < 8; i++) { // FIXME: 8?
+    while(1) {
         mutex->lock();
         btn = mail_box->alloc();
-        if(!btn) break;
+        if(!btn) {
+            mutex->unlock();
+            continue;
+        }
         *btn = source->await();
         mail_box->put(btn);
         mutex->unlock();