fedora 24
obsolete weakness #270

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/winmmemidi_output_device.cc

Context:

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

 
	if (!CloseHandle (m_timer)) {
		DEBUG_MIDI ("WinMMEMidiOutput: unable to close waitable timer\n");
		return false;
	}
	m_timer = 0;
	return true;
}

bool
WinMMEMidiOutputDevice::start_midi_output_thread ()
{
	m_thread_quit = false;

	//pthread_attr_t attr;
	size_t stacksize = 100000;

	// TODO Use native threads
	if (_realtime_pthread_create (SCHED_FIFO, -21, stacksize,
				&m_output_thread_handle, midi_output_thread, this)) {
		return false;
	}

	int timeout = 5000;
	while (!m_thread_running && --timeout > 0) { Glib::usleep (1000); }
	if (timeout == 0 || !m_thread_running) {
		DEBUG_MIDI (string_compose ("Unable to start midi output device thread: %1\n",
					    m_name));
		return false;
	}
	return true;
}

bool
WinMMEMidiOutputDevice::stop_midi_output_thread ()
{
	int timeout = 5000;
	m_thread_quit = true;
	signal (m_queue_semaphore);

	while (m_thread_running && --timeout > 0) { Glib::usleep (1000); }
	if (timeout == 0 || m_thread_running) {
		DEBUG_MIDI (string_compose ("Unable to stop midi output device thread: %1\n",
					     m_name));
		return false;
	}

	void *status;
	if (pthread_join (m_output_thread_handle, &status)) {
		DEBUG_MIDI (string_compose ("Unable to join midi output device thread: %1\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.