return -1;
}
- if (pthread_create_and_store (X_("tranzport monitor"), &thread, 0, _monitor_work, this) == 0) {
+ if (pthread_create_and_store (X_("tranzport monitor"), &thread, _monitor_work, this) == 0) {
_active = true;
-#if TRANZPORT_THREADS
- if (pthread_create_and_store (X_("tranzport read"), &thread_read, 0, _read_work, this) == 0) {
- _active_read = true;
- if (pthread_create_and_store (X_("tranzport write"), &thread_write, 0, _write_work, this) == 0) {
- _active_write = true;
- if (pthread_create_and_store (X_("tranzport process"), &thread_process, 0, _process_work, this) == 0) {
- _active_process = true;
- if (pthread_create_and_store (X_("tranzport timer"), &thread_timer, 0, _process_timer, this) == 0) {
- _active_process = true;
-#endif
} else {
return -1;
}
// thread FIXME - wait til all writes are done
for(int x = 0; (x < 20/MAX_TRANZPORT_INFLIGHT) && flush(); x++) { usleep(100); }
}
-#if TRANZPORT_THREADS
- pthread_cancel_one (_thread_timer);
- pthread_cancel_one (_thread_process);
- pthread_cancel_one (_thread_read);
- pthread_cancel_one (_thread_write);
-#endif
+
pthread_cancel_one (thread);
cerr << "Tranzport Thread dead\n";
close ();
_active = false;
cerr << "End tranzport shutdown\n";
- }
+ }
}
return 0;
bool first_time = true;
uint8_t offline = 0;
- PBD::ThreadCreated (pthread_self(), X_("Tranzport"));
+ register_thread (X_("Tranzport"));
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, 0);
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
rtpriority_set();