Commit ab48279cb499e8e18327cb1a4d00a95bf06c28b9

Authored by Filipe Gama
1 parent b8149f2e

Publish the name of the created channels

Showing 1 changed file with 6 additions and 4 deletions
... ... @@ -23,17 +23,19 @@ int main(int argc, char **argv){
input.open(input_name, BLC_CHANNEL_READ);
blc_loop_try_add_waiting_semaphore(input.sem_new_data);
blc_loop_try_add_posting_semaphore(input.sem_ack_data);
output1.create_or_open(output_name1, BLC_CHANNEL_WRITE, input.type, input.format, input.dims_nb, input.dims);
output2.create_or_open(output_name2, BLC_CHANNEL_WRITE, input.type, input.format, input.dims_nb, input.dims);
output1.publish();
output2.publish();
BLC_COMMAND_LOOP(0){
if (output1.sem_ack_data) sem_wait(output1.sem_ack_data);
memcpy(output1.data, input.data, output1.size);
if (output1.sem_new_data) sem_post(output1.sem_new_data);
if (output2.sem_ack_data) sem_wait(output2.sem_ack_data);
memcpy(output2.data, input.data, output2.size);
if (output2.sem_new_data) sem_post(output2.sem_new_data);
... ...