+ struct hotplug_msg *loop_msg;
+ struct hotplug_msg *tmp_msg;
+ struct hotplug_msg *msg;
+ pthread_t run_tid;
+
+ while (1) {
+ pthread_mutex_lock(&exec_lock);
+ list_for_each_entry_safe(loop_msg, tmp_msg, &exec_list, list) {
+ msg = running_with_devpath(loop_msg);
+ if (msg == NULL) {
+ /* move event to run list */
+ pthread_mutex_lock(&running_lock);
+ list_move_tail(&loop_msg->list, &running_list);
+ pthread_mutex_unlock(&running_lock);
+
+ pthread_create(&run_tid, &thr_attr, run_threads, (void *) loop_msg);
+
+ dbg("moved seq %d to running list", loop_msg->seqnum);
+ } else {
+ dbg("delay seq %d, cause seq %d already working on '%s'",
+ loop_msg->seqnum, msg->seqnum, msg->devpath);
+ }
+ }
+ pthread_mutex_unlock(&exec_lock);
+
+ /* wait for activation, new events or childs coming back */
+ pthread_mutex_lock(&exec_active_lock);
+ pthread_cond_wait(&exec_active, &exec_active_lock);
+ pthread_mutex_unlock(&exec_active_lock);