eio: check if we need to wake up thread when the memory limit is changed.
authorCedric BAIL <cedric.bail@samsung.com>
Fri, 7 Mar 2014 07:49:14 +0000 (16:49 +0900)
committerCedric BAIL <cedric.bail@samsung.com>
Fri, 7 Mar 2014 07:49:14 +0000 (16:49 +0900)
src/lib/eio/eio_main.c

index e70e83c..632d022 100644 (file)
@@ -360,7 +360,14 @@ eio_shutdown(void)
 EAPI void
 eio_memory_burst_limit_set(size_t limit)
 {
+   eina_lock_take(&(memory_pool_mutex));
    memory_pool_limit = limit;
+   if (memory_pool_suspended)
+     {
+        if (memory_pool_usage < memory_pool_limit)
+          eina_condition_broadcast(&(memory_pool_cond));
+     }
+   eina_lock_release(&(memory_pool_mutex));
 }
 
 EAPI size_t