void *hex_producer(void *arg) { (void) arg; // sorted by probability: bool stop = hex_producer_list(5, 3) // 5 digits, 3 letters: 0.281632 || hex_producer_list(6, 2) // 6 digits, 2 letters: 0.234693 || hex_producer_list(4, 4) // 4 digits, 4 letters: 0.211224 || hex_producer_list(7, 1) // 7 digits, 1 letters: 0.111759 || hex_producer_list(3, 5) // 3 digits, 5 letters: 0.101388 || hex_producer_list(2, 6) // 2 digits, 6 letters: 0.030416 || hex_producer_list(8, 0) // 8 digits, 0 letters: 0.023283 || hex_producer_list(1, 7) // 1 digits, 7 letters: 0.005214 || hex_producer_list(0, 8);// 0 digits, 8 letters: 0.000391 if(!stop) producer_stop(); return NULL; }
celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context) { celix_status_t status = CELIX_SUCCESS; bundle_activator_pt activator = (bundle_activator_pt) userData; printf("PRODUCER: Stopping bundle...\n"); serviceTracker_close(activator->tracker); serviceTracker_destroy(activator->tracker); serviceRegistration_unregister(activator->producerStatsRegistration); serviceRegistration_unregister(activator->producerRegistration); producer_stop(activator->producer); return status; }