DSI threading helpers

Functions helping to operate witch threads. More...

Functions

int dsi_thread_start_worker (dsi_socket_t *socket, l4_umword_t *ret_code)
 Send start message to work thread and wait for ready-notification.

We start the work-thread and wait until it gives an ok..

int dsi_thread_worker_wait (dsi_socket_t **socket)
 Wait until our parent sends the socket.
int dsi_thread_worker_started (int ret_code)
 Send ready-notification to parent thread.

Detailed Description

Functions helping to operate witch threads.


Function Documentation

int dsi_thread_start_worker ( dsi_socket_t socket,
l4_umword_t *  ret_code 
)

Send start message to work thread and wait for ready-notification.

We start the work-thread and wait until it gives an ok..

Parameters:
socket socket descriptor
ret_code (optional) pointer to the return-code provided by the worker-thread with dsi_thread_worker_started()
Return values:
0 on success
-DROPS_EIPC error sending start IPC
The intention of this function is to be used by the creator of a socket in conjunction with dsi_thread_worker_wait() used by the worker thread. If the creator creates a worker-thread that handles the socket, it cannot create the socket prior to the worker-thread, because the worker-id is needed for socket-creation. Thus, the worker-thread must be created and wait to be notified about the socket then.

Definition at line 50 of file convenience.c.

References dsi_socket::work_th.

int dsi_thread_worker_started ( int  ret_code  ) 

Send ready-notification to parent thread.

Parameters:
ret_code code to be send to the parent
Return values:
0 on success
-DROPS_EIPC error sending start IPC
This function should be used by a worker thread to indicate that it started. An error-code can be passed to the parent.

Definition at line 110 of file convenience.c.

int dsi_thread_worker_wait ( dsi_socket_t **  socket  ) 

Wait until our parent sends the socket.

Parameters:
socket will be filled with the socket descriptor
Return values:
0 on success, IPC-error otherwise
This function should be called by a worker-thread after it was created by its parent. It informs the caller about the socket to use.

Note:
This function is only useful in conjunction with dsi_thread_start_worker().

Definition at line 84 of file convenience.c.


Generated on Wed Apr 11 06:40:14 2012 for DSI - Drops Streaming Interface by  doxygen 1.5.6