Add channel module

- Add channel module that exposes the API over arbitrary streams
- Add `xmemdup` for duplicating memory chunks
- Make job exit callback optional
This commit is contained in:
Thiago de Arruda
2014-05-07 17:59:57 -03:00
parent b3268d0712
commit f9c06e47c4
8 changed files with 242 additions and 3 deletions

View File

@@ -7,6 +7,7 @@
#include "lib/klist.h"
#include "os/event.h"
#include "os/input.h"
#include "os/channel.h"
#include "os/signal.h"
#include "os/rstream.h"
#include "os/job.h"
@@ -36,6 +37,8 @@ void event_init()
signal_init();
// Jobs
job_init();
// Channels
channel_init();
uv_timer_init(uv_default_loop(), &timer);
// This prepare handle that actually starts the timer
uv_prepare_init(uv_default_loop(), &timer_prepare);
@@ -43,6 +46,7 @@ void event_init()
void event_teardown()
{
channel_teardown();
job_teardown();
}