Commit a32dcac9 authored by julien.delange's avatar julien.delange
Browse files

separation of the sockets driver



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@544 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 15b18b60
......@@ -19,6 +19,10 @@ int __po_hi_initialize ();
* __PO_HI_ERROR_PTHREAD_BARRIER.
*/
void __po_hi_initialize_add_task ();
/*
* Declare that another task has to be initialized
*/
int __po_hi_wait_initialization ();
/*
......
......@@ -93,7 +93,7 @@ typedef struct
__po_hi_inetnode_t nodes[__PO_HI_NB_NODES];
__po_hi_inetnode_t rnodes[__PO_HI_NB_NODES];
void __po_hi_sockets_initialize (void)
void __po_hi_driver_sockets_init (void)
{
int i;
int ret;
......@@ -111,6 +111,7 @@ void __po_hi_sockets_initialize (void)
nodes[node].socket = -1;
}
/*
* If the current node port has a port number, then it has to
* listen to other nodes. So, we create a socket, bind it and
......@@ -155,8 +156,9 @@ void __po_hi_sockets_initialize (void)
* __po_hi_receiver_task
*/
__po_hi_initialize_add_task ();
__po_hi_create_generic_task
(-1, 0,__PO_HI_MAX_PRIORITY, 0, __po_hi_sockets_receiver_task);
(-1, 0,__PO_HI_MAX_PRIORITY, 0, __po_hi_sockets_receiver_task);
}
......
......@@ -19,11 +19,6 @@
#include <po_hi_task.h>
#include <po_hi_protected.h>
#if __PO_HI_NB_PORTS > 1
#include <po_hi_transport.h>
#include <drivers/po_hi_driver_sockets.h>
#endif
/* included files from PolyORB-HI-C */
void __po_hi_initialize_transport ();
......@@ -33,6 +28,11 @@ pthread_mutex_t mutex_init;
int initialized_tasks;
int nb_tasks_to_init;
void __po_hi_initialize_add_task ()
{
nb_tasks_to_init++;
}
int __po_hi_initialize ()
{
if (pthread_mutex_init (&mutex_init, NULL) != 0 )
......@@ -45,15 +45,6 @@ int __po_hi_initialize ()
*/
nb_tasks_to_init = __PO_HI_NB_TASKS + 1;
#ifdef __PO_HI_NEED_DRIVER_SOCKETS
#if __PO_HI_NB_PORTS > 1
if (__PO_HI_TRANSPORT_SOCKET_NEED_RECEIVER_TASK ())
{
nb_tasks_to_init++;
}
#endif
#endif
initialized_tasks = 0;
if (pthread_cond_init (&cond_init,
......
......@@ -32,9 +32,6 @@ entity_table[__PO_HI_NB_ENTITIES];
void __po_hi_initialize_transport ()
{
#if defined (__PO_HI_NEED_DRIVER_SOCKETS) && (__PO_HI_NB_NODES > 1)
__po_hi_sockets_initialize ();
#endif
}
int __po_hi_transport_send (__po_hi_entity_t from,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment