Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : update bugged mutual exclusion algorithm
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Wed, 2 Oct 2013 14:12:38 +0000 (16:12 +0200)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Fri, 4 Oct 2013 13:21:19 +0000 (15:21 +0200)
examples/msg/mc/bugged1_liveness.c
examples/smpi/mc/bugged1_liveness.c

index bd59651..b6949dd 100644 (file)
@@ -51,7 +51,7 @@ int coordinator(int argc, char *argv[])
     } else {      
       if (!xbt_dynar_is_empty(requests)) {
         XBT_INFO("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
     } else {      
       if (!xbt_dynar_is_empty(requests)) {
         XBT_INFO("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
-        xbt_dynar_pop(requests, &req);
+        xbt_dynar_shift(requests, &req);
         if(strcmp(req, "1") != 0){
           MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
         }else{
         if(strcmp(req, "1") != 0){
           MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
         }else{
index 4b5b067..eab2b55 100644 (file)
@@ -65,7 +65,7 @@ int main(int argc, char **argv){
       }else{
         if(!xbt_dynar_is_empty(requests)){
           printf("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
       }else{
         if(!xbt_dynar_is_empty(requests)){
           printf("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
-          xbt_dynar_pop(requests, &recv_buff);
+          xbt_dynar_shift(requests, &recv_buff);
           if(recv_buff != 1){
             MPI_Send(&rank, 1, MPI_INT, recv_buff, GRANT_TAG, MPI_COMM_WORLD);
             CS_used = 1;
           if(recv_buff != 1){
             MPI_Send(&rank, 1, MPI_INT, recv_buff, GRANT_TAG, MPI_COMM_WORLD);
             CS_used = 1;