fedora 24
obsolete weakness #258

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/alsa/alsa_midi.cc

Context:

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

 }

static void * pthread_process (void *arg)
{
	AlsaMidiIO *d = static_cast<AlsaMidiIO *>(arg);
	d->main_process_thread ();
	pthread_exit (0);
	return 0;
}

int
AlsaMidiIO::start ()
{
	if (_realtime_pthread_create (SCHED_FIFO, -21, 100000,
				&_main_thread, pthread_process, this))
	{
		if (pthread_create (&_main_thread, NULL, pthread_process, this)) {
			PBD::error << _("AlsaMidiIO: Failed to create process thread.") << endmsg;
			return -1;
		} else {
			PBD::warning << _("AlsaMidiIO: Cannot acquire realtime permissions.") << endmsg;
		}
	}
	int timeout = 5000;
	while (!_running && --timeout > 0) { Glib::usleep (1000); }
	if (timeout == 0 || !_running) {
		return -1;
	}
	return 0;
}

int
AlsaMidiIO::stop ()
{
	void *status;
	if (!_running) {
		return 0;
	}

	_running = false;

	pthread_mutex_lock (&_notify_mutex);
	pthread_cond_signal (&_notify_ready);
	pthread_mutex_unlock (&_notify_mutex);

	if (pthread_join (_main_thread, &status)) {
		PBD::error << _("AlsaMidiIO: Failed to terminate.") << endmsg;
		return -1;
	}
	return 0; 

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.