From b90a3893809fc7960becec79b01bcef12494be40 Mon Sep 17 00:00:00 2001 From: fpagliughi Date: Thu, 9 Jan 2025 20:18:34 -0500 Subject: [PATCH] Removed the mutex_type.h header; merged mutex into Thread.h --- src/Socket.h | 2 +- src/Thread.h | 5 +++-- src/mutex_type.h | 25 ------------------------- 3 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 src/mutex_type.h diff --git a/src/Socket.h b/src/Socket.h index 5ec65eab..efb91c41 100644 --- a/src/Socket.h +++ b/src/Socket.h @@ -70,7 +70,7 @@ #define SOCKET int #endif -#include "mutex_type.h" /* Needed for mutex_type */ +#include "Thread.h" /* Needed for mutex_type */ /** socket operation completed successfully */ #define TCPSOCKET_COMPLETE 0 diff --git a/src/Thread.h b/src/Thread.h index bb249aee..05f1fb67 100644 --- a/src/Thread.h +++ b/src/Thread.h @@ -33,10 +33,10 @@ #include "MQTTClient.h" -#include "mutex_type.h" /* Needed for mutex_type */ - #if defined(_WIN32) #include + + #define mutex_type HANDLE #define thread_type HANDLE #define thread_id_type DWORD #define thread_return_type DWORD @@ -48,6 +48,7 @@ #else #include + #define mutex_type pthread_mutex_t* #define thread_type pthread_t #define thread_id_type pthread_t #define thread_return_type void* diff --git a/src/mutex_type.h b/src/mutex_type.h deleted file mode 100644 index 1203055a..00000000 --- a/src/mutex_type.h +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2018 IBM Corp. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. - * - * The Eclipse Public License is available at - * https://www.eclipse.org/legal/epl-2.0/ - * and the Eclipse Distribution License is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - *******************************************************************************/ -#if !defined(_MUTEX_TYPE_H_) -#define _MUTEX_TYPE_H_ - -#if defined(_WIN32) - #include - #define mutex_type HANDLE -#else - #include - #define mutex_type pthread_mutex_t* -#endif - -#endif /* _MUTEX_TYPE_H_ */