From: mquinson Date: Mon, 5 Jul 2004 23:21:09 +0000 (+0000) Subject: move the dynar of all known sockets from RL-only to procdata (SG-wanna-accept change) X-Git-Tag: v3.3~5177 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/168dc880e22aca384071d6f8dd39ec26bd094c4e move the dynar of all known sockets from RL-only to procdata (SG-wanna-accept change) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@169 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Virtu/process.c b/src/gras/Virtu/process.c index e46303e695..50676f8966 100644 --- a/src/gras/Virtu/process.c +++ b/src/gras/Virtu/process.c @@ -35,6 +35,7 @@ gras_procdata_init() { pd->userdata = NULL; TRY(gras_dynar_new( &(pd->msg_queue), sizeof(gras_msg_t), NULL )); TRY(gras_dynar_new( &(pd->cbl_list), sizeof(gras_cblist_t *), NULL )); + TRY(gras_dynar_new( &(pd->sockets), sizeof(gras_socket_t*), NULL)); return no_error; } @@ -44,5 +45,10 @@ gras_procdata_exit() { gras_dynar_free(pd->msg_queue); gras_dynar_free(pd->cbl_list); + gras_dynar_free(pd->sockets); } +gras_dynar_t * +gras_socketset_get(void) { + return gras_procdata_get()->sockets; +} diff --git a/src/gras/Virtu/virtu_interface.h b/src/gras/Virtu/virtu_interface.h index 4cd715393d..74ed9f7ce6 100644 --- a/src/gras/Virtu/virtu_interface.h +++ b/src/gras/Virtu/virtu_interface.h @@ -25,19 +25,18 @@ typedef struct { /* registered callbacks for each message */ gras_dynar_t *cbl_list; /* elm type: gras_cblist_t */ - - /* The channel we are listening to in SG for formated messages */ - int chan; - gras_socket_t *sock; /* the corresponding socket (SG only) */ - - /* The channel we are listening to in SG for raw send/recv */ - int rawChan; - gras_socket_t *rawSock;/* the corresponding socket (SG only) */ + /* SG only elements. In RL, they are part of the OS ;) */ + int chan; /* Formated messages channel */ + int rawChan; /* Unformated echange channel */ + gras_dynar_t *sockets; /* all sockets known to this process */ /* globals of the process */ void *userdata; } gras_procdata_t; +/* Access */ +gras_dynar_t * gras_socketset_get(void); + /* FIXME: mv to _private? */ gras_procdata_t *gras_procdata_get(void); gras_error_t gras_procdata_init(void);