fedora 24
obsolete weakness #268

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

Ardour-5.10.0/libs/backends/portaudio/portaudio_backend.cc

Context:

The highlighted line of code below is the trigger point of this particular Fedora 24 obsolete weakness.

 	}

	unregister_ports();

	return (_active == false) ? 0 : -1;
}

static void* freewheel_thread(void* arg)
{
	PortAudioBackend* d = static_cast<PortAudioBackend*>(arg);
	d->freewheel_process_thread ();
	pthread_exit (0);
	return 0;
}

bool
PortAudioBackend::start_freewheel_process_thread ()
{
	if (pthread_create(&_pthread_freewheel, NULL, freewheel_thread, this)) {
		DEBUG_AUDIO("Failed to create main audio thread\n");
		return false;
	}

	int timeout = 5000;
	while (!_freewheel_thread_active && --timeout > 0) { Glib::usleep (1000); }

	if (timeout == 0 || !_freewheel_thread_active) {
		DEBUG_AUDIO("Failed to start freewheel thread\n");
		return false;
	}
	return true;
}

bool
PortAudioBackend::stop_freewheel_process_thread ()
{
	void *status;

	if (!_freewheel_thread_active) {
		return true;
	}

	DEBUG_AUDIO("Signaling freewheel thread to stop\n");

	pthread_mutex_lock (&_freewheel_mutex);
	pthread_cond_signal (&_freewheel_signal);
	pthread_mutex_unlock (&_freewheel_mutex);

	if (pthread_join (_pthread_freewheel, &status) != 0) {
		DEBUG_AUDIO("Failed to stop freewheel thread\n"); 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.