Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use xbt_XXX_is_empty() instead of testing xbt_XXX_length() against 0.
[simgrid.git] / examples / msg / mc / centralized_mutex.c
index bc2e329..5cfb74f 100644 (file)
@@ -34,7 +34,7 @@ int coordinator(int argc, char *argv[])
         CS_used = 1;
       }
     } else {                    // that's a release. Check if someone was waiting for the lock
-      if (xbt_dynar_length(requests) > 0) {
+      if (!xbt_dynar_is_empty(requests)) {
         XBT_INFO("CS release. Grant to queued requests (queue size: %lu)",
               xbt_dynar_length(requests));
         char *req;