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){ @@ -23,17 +23,19 @@ int main(int argc, char **argv){
23 input.open(input_name, BLC_CHANNEL_READ); 23 input.open(input_name, BLC_CHANNEL_READ);
24 blc_loop_try_add_waiting_semaphore(input.sem_new_data); 24 blc_loop_try_add_waiting_semaphore(input.sem_new_data);
25 blc_loop_try_add_posting_semaphore(input.sem_ack_data); 25 blc_loop_try_add_posting_semaphore(input.sem_ack_data);
26 - 26 +
27 27
28 output1.create_or_open(output_name1, BLC_CHANNEL_WRITE, input.type, input.format, input.dims_nb, input.dims); 28 output1.create_or_open(output_name1, BLC_CHANNEL_WRITE, input.type, input.format, input.dims_nb, input.dims);
29 output2.create_or_open(output_name2, BLC_CHANNEL_WRITE, input.type, input.format, input.dims_nb, input.dims); 29 output2.create_or_open(output_name2, BLC_CHANNEL_WRITE, input.type, input.format, input.dims_nb, input.dims);
30 -  
31 - 30 +
  31 + output1.publish();
  32 + output2.publish();
  33 +
32 BLC_COMMAND_LOOP(0){ 34 BLC_COMMAND_LOOP(0){
33 if (output1.sem_ack_data) sem_wait(output1.sem_ack_data); 35 if (output1.sem_ack_data) sem_wait(output1.sem_ack_data);
34 memcpy(output1.data, input.data, output1.size); 36 memcpy(output1.data, input.data, output1.size);
35 if (output1.sem_new_data) sem_post(output1.sem_new_data); 37 if (output1.sem_new_data) sem_post(output1.sem_new_data);
36 - 38 +
37 if (output2.sem_ack_data) sem_wait(output2.sem_ack_data); 39 if (output2.sem_ack_data) sem_wait(output2.sem_ack_data);
38 memcpy(output2.data, input.data, output2.size); 40 memcpy(output2.data, input.data, output2.size);
39 if (output2.sem_new_data) sem_post(output2.sem_new_data); 41 if (output2.sem_new_data) sem_post(output2.sem_new_data);