 + * ToDo: Rewrite this in C instead of C++.
 + */
 +
++#include <stdio.h>
++#include <stdlib.h>
 +#include "global_mutex.h"
 +
 +#ifdef _WIN32

+{
+#if defined(linux) || defined(__linux__) || defined(__gnu_linux__) || defined(__linux)
+	static pthread_mutex_t mutex_ = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
+	static pthread_mutex_t mutex_ = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
+#endif
+
+#if defined(_WIN32) || defined(VXWORKS_PPC)
+	struct _CriticalSection
+	{
+#ifdef _WIN32
+		CRITICAL_SECTION cs_;
+#elif defined VXWORKS_PPC
+		SEM_ID sem_;
+#endif
+
+		inline _CriticalSection()

From 215849695855605bd6f618478dec36220f9ca933 Mon Sep 17 00:00:00 2001
From: Jonathan David <jonathan.david@ni.com>
Date: Thu, 18 Feb 2016 11:30:26 -0600
Subject: [PATCH 10/21] Add mutex locking and unlocking

Include global_mutex.cpp and global_mutex.h to allow for
thread-safe operation. Provides functions for recursive mutex
