X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cc01c6a871dbbfd0cc84e26eb9f94aeb539e613e..23e3b951a5bc0e18ab5de0edbed5be9d5e334ef7:/doc/gtut-files/11-explicitwait.c diff --git a/doc/gtut-files/11-explicitwait.c b/doc/gtut-files/11-explicitwait.c index 4923f8d244..f13c7e9612 100644 --- a/doc/gtut-files/11-explicitwait.c +++ b/doc/gtut-files/11-explicitwait.c @@ -28,11 +28,11 @@ int server_request_cb(gras_msg_cb_ctx_t ctx, void *payload) if (globals->process_in_CS) { xbt_dynar_push(globals->waiting_queue, &s); - INFO2("put %s:%d in waiting queue", gras_socket_peer_name(s), + XBT_INFO("put %s:%d in waiting queue", gras_socket_peer_name(s), gras_socket_peer_port(s)); } else { globals->process_in_CS = 1; - INFO2("grant %s:%d since nobody wanted it", gras_socket_peer_name(s), + XBT_INFO("grant %s:%d since nobody wanted it", gras_socket_peer_name(s), gras_socket_peer_port(s)); gras_msg_send(s, "grant", NULL); } @@ -43,11 +43,11 @@ int server_release_cb(gras_msg_cb_ctx_t ctx, void *payload) { server_data_t *globals = (server_data_t *) gras_userdata_get(); - if (xbt_dynar_length(globals->waiting_queue)) { + if (!xbt_dynar_is_empty(globals->waiting_queue)) { gras_socket_t s; xbt_dynar_pop(globals->waiting_queue, &s); - INFO2("grant %s:%d since token released", gras_socket_peer_name(s), + XBT_INFO("grant %s:%d since token released", gras_socket_peer_name(s), gras_socket_peer_port(s)); gras_msg_send(s, "grant", NULL); } else { @@ -87,12 +87,12 @@ void lock(gras_socket_t toserver) { gras_msg_send(toserver, "request", NULL); gras_msg_wait(-1, "grant", NULL, NULL); - INFO0("Granted by server"); + XBT_INFO("Granted by server"); } /* end_of_lock */ void unlock(gras_socket_t toserver) { - INFO0("Release the token"); + XBT_INFO("Release the token"); gras_msg_send(toserver, "release", NULL); } /* end_of_unlock */ @@ -106,7 +106,7 @@ int client(int argc, char *argv[]) mysock = gras_socket_server_range(1024, 10000, 0, 0); - VERB1("Client ready; listening on %d", gras_socket_my_port(mysock)); + XBT_VERB("Client ready; listening on %d", gras_socket_my_port(mysock)); gras_os_sleep(1.5); /* sleep 1 second and half */ message_declaration();