-From fd095bcc67c5380a97e2f75b40b1356962ee0b5f Mon Sep 17 00:00:00 2001
+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/22] Add mutex locking and unlocking
+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

+			InitializeCriticalSection(&cs_);
+#elif defined VXWORKS_PPC
+			sem_ = semMCreate(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE);
+#endif
+		}
+
+		inline ~_CriticalSection()
+		{
+#ifdef _WIN32
+			DeleteCriticalSection(&cs_);
+#elif defined VXWORKS_PPC
+			semDelete(sem_);
+#endif
+		}
+

+	void curl_global_mutex_lock()
+	{
+		// Do NOT add try/catch blocks here. See comments above for details.
+#if defined(_WIN32) || defined(VXWORKS_PPC) || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
+		g_cs.lock();
+#elif defined(linux) || defined(__linux__) || defined(__gnu_linux__) || defined(__linux)
+                if (pthread_mutex_lock(&mutex_))
+                {
+                        perror("cURL fatal error: Error locking mutex");
+                        exit(-1);
+                }
+#endif
+	}
+
+	void curl_global_mutex_unlock()
+	{
+		// Do NOT add try/catch blocks here. See comments above for details.
+#if defined(_WIN32) || defined(VXWORKS_PPC) || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
+		g_cs.unlock();
+#elif defined(linux) || defined(__linux__) || defined(__gnu_linux__) || defined(__linux)
+                if (pthread_mutex_unlock(&mutex_))
+                {
+                        perror("cURL fatal error: Error unlocking mutex");
+                        exit(-1);
+                }
+#endif
+	}
+}
