- code cleaned up

This commit is contained in:
Jan Hutter
2005-12-06 16:04:39 +00:00
parent 2b54748131
commit f104664836
9 changed files with 88 additions and 51 deletions
+2 -1
View File
@@ -25,13 +25,14 @@
#include <types.h>
typedef struct receiver_t receiver_t;
/**
* @brief Receives packets from the socket and adds them to the job queue.
*
* The receiver starts a thread, wich reads on the blocking socket. If
* there is data available, a packet_t is created from the data, wrapped
* data is available, a packet_t object is created , wrapped
* in an incoming_packet_job_t and added to the job queue.
*
* @ingroup threads
+10 -9
View File
@@ -32,38 +32,39 @@
#include <utils/allocator.h>
#include <utils/logger_manager.h>
typedef struct private_sender_t private_sender_t;
/**
* Private data of a sender object
* Private data of a sender_t object.
*/
struct private_sender_t {
/**
* Public part of a sender object
* Public part of a sender_t object.
*/
sender_t public;
/**
* Assigned thread to the sender_t object
* Assigned thread.
*/
pthread_t assigned_thread;
/**
* @brief The threads function, sends out packets.
* @brief The thread function, sends out packets.
*
* @param this assigned sender object
* @param this calling object
*/
void (*send_packets) (private_sender_t * this);
/**
* logger for this sender
* A logger for this sender_t object.
*/
logger_t *logger;
};
/**
* implements private_sender_t.send_packets
* Implementation of private_sender_t.send_packets.
*/
static void send_packets(private_sender_t * this)
{
@@ -90,7 +91,7 @@ static void send_packets(private_sender_t * this)
}
/**
* implements sender_t.destroy
* Implementation of sender_t.destroy.
*/
static void destroy(private_sender_t *this)
{
@@ -106,7 +107,7 @@ static void destroy(private_sender_t *this)
}
/*
* see header
* Described in header.
*/
sender_t * sender_create()
{
+7 -4
View File
@@ -28,16 +28,19 @@
typedef struct sender_t sender_t;
/**
* @brief Sends packets over the socket.
* @brief Thread responsible for sending packets over the socket.
*
* @b Constructors:
* - sender_create()
*
* @ingroup threads
*/
struct sender_t {
/**
* @brief Destroys a sender object
* @brief Destroys a sender object.
*
* @param sender sender object
* @param sender calling object
*/
void (*destroy) (sender_t *sender);
};
@@ -50,7 +53,7 @@ struct sender_t {
* from the send queue and sends them out.
*
* @return
* - created sender_t, or
* - sender_t object
* - NULL of thread could not be started
*
* @ingroup threads