[Core] Add Name and Thread ID members

The Name and Thread ID attributes could be used to support logging and
a better threads identification.

Signed-off-by: Patrick Bellasi <derkling@gmail.com>
[Core] Add thread name on log sentences

Each log output is pre-pended with the thread name for a better reporting
of complex networks of ProgramControlBlocks.

Signed-off-by: Patrick Bellasi <derkling@gmail.com>
[Core] Split run from synchronization

The wait for completion of a ProgramControlBlock is factorized into a dedicated
method which is required to setup a complex network with many PCB to be
started concurrently.

Signed-off-by: Patrick Bellasi <derkling@gmail.com>
[Core] Add cleanup method

The Cleanup method is called once a ProgramControlBlock completes, just
before returning. This is a proper time to release all resources eventaully
acquired in the Setup step.

Signed-off-by: Patrick Bellasi <derkling@gmail.com>
[SyncBarrier] Add first implementation

This provides a simple implementation for a generic "Single-Producer Multiple-Consumer"
synchronization barrier. Such a barrier exposes the required support to
properly handle double-buffering of a generic datatype T; where T could be, for example,
a pointer to an image buffer.

This kind of barrier allows to setup both SPSC pipelines as well as SPMC
fork patterns. The only constraints are:
1. each consumer does not modify the input buffer;
2. each consumer does _at least one PULL_ of the input buffer;
3. both the producer and all the consumers uses (respectively) as output
   and input buffer :
   a. the one returned by buffer_push/buffer_pull
   b. the one returned by producerBuffer/consumerBuffer, after a push/pull
      operation has been performed.

TODO: optimize the template for the SPSC case in order to optimize
      pipeline based (sub)networks.

Signed-off-by: Patrick Bellasi <derkling@gmail.com>
[Network] This adds a simple example network

This is the initial example of a concurrent network of PCB.
The network structure is:

          +––––––––+
     +––––+ Source +–––––+
     |    +––––––––+     |
     V                   V
+––––––––––+      +–––––––––––+
|LeftAdder1|      |RightAdder1|
+––––––––––+      +–––––––––––+
     |                   |
     V                   V
+––––––––––+      +–––––––––––+
|LeftAdder2|      |RightAdder2|
+––––+–––––+      +––––––+––––+
     |                   |
     |    +–––––––+      |
     +--->|  Sink |<-----+
          +–––––––+

The Source produce a seed, the two left and right pipelines does the same
computation. Finally, the Sink verify that the two computations match.

All the connection are done using SPSC barriers, but the Source uses a
fork barrier which has 2 associated consumers.

NOTE: the building system is not integrated, thus EXAMPLE_NETWORK should
be added to CFLAGS to enable this code.

Signed-off-by: Patrick Bellasi <derkling@gmail.com>
[Core] Move initial Debug macro outside of generated code section

The initial Debug statement is not part of the generated code, since this
call should always be present.

Signed-off-by: Patrick Bellasi <derkling@gmail.com>