From a8fd3e31edfd8dc1640d2e38d27f1c1a415c2bbf Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Tue, 31 Dec 2013 11:54:08 +0100
Subject: [PATCH] Removed POLARSSL_THREADING_DUMMY option
---
ChangeLog | 1 +
include/polarssl/config.h | 24 ++----------------------
include/polarssl/threading.h | 4 ----
library/threading.c | 31 -------------------------------
4 files changed, 3 insertions(+), 57 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 506d96a8a..03215e723 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,7 @@ Changes
* Split off curves from ecp.c into ecp_curves.c
* Curves are now stored fully in ROM
* Memory usage optimizations in ECP module
+ * Removed POLARSSL_THREADING_DUMMY
Bugfix
* Fixed bug in mpi_set_bit() on platforms where t_uint is wider than int
diff --git a/include/polarssl/config.h b/include/polarssl/config.h
index dfd107ab6..ca0c1763f 100644
--- a/include/polarssl/config.h
+++ b/include/polarssl/config.h
@@ -806,19 +806,6 @@
*/
//#define POLARSSL_THREADING_ALT
-/**
- * \def POLARSSL_THREADING_DUMMY
- *
- * Provide a dummy threading implementation.
- * Warning: If you use this, all claims of thread-safety in the documentation
- * are void!
- *
- * Requires: POLARSSL_THREADING_C
- *
- * Uncomment this to enable code to compile like with threading enabled
- */
-//#define POLARSSL_THREADING_DUMMY
-
/**
* \def POLARSSL_THREADING_PTHREAD
*
@@ -1709,8 +1696,8 @@
* This allows different threading implementations (self-implemented or
* provided).
*
- * You will have to enable either POLARSSL_THREADING_ALT,
- * POLARSSL_THREADING_PTHREAD or POLARSSL_THREADING_DUMMY.
+ * You will have to enable either POLARSSL_THREADING_ALT or
+ * POLARSSL_THREADING_PTHREAD.
*
* Enable this layer to allow use of mutexes within PolarSSL
*/
@@ -2127,13 +2114,6 @@
#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
#endif
-#if defined(POLARSSL_THREADING_DUMMY)
-#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
-#error "POLARSSL_THREADING_DUMMY defined, but not all prerequisites"
-#endif
-#define POLARSSL_THREADING_IMPL
-#endif
-
#if defined(POLARSSL_THREADING_PTHREAD)
#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
#error "POLARSSL_THREADING_PTHREAD defined, but not all prerequisites"
diff --git a/include/polarssl/threading.h b/include/polarssl/threading.h
index ceb127798..87071523d 100644
--- a/include/polarssl/threading.h
+++ b/include/polarssl/threading.h
@@ -39,10 +39,6 @@ extern "C" {
#define POLARSSL_ERR_THREADING_BAD_INPUT_DATA -0x001C /**< Bad input parameters to function. */
#define POLARSSL_ERR_THREADING_MUTEX_ERROR -0x001E /**< Locking / unlocking / free failed with error code. */
-#if defined(POLARSSL_THREADING_DUMMY)
-typedef void threading_mutex_t;
-#endif
-
#if defined(POLARSSL_THREADING_PTHREAD)
#include
typedef pthread_mutex_t threading_mutex_t;
diff --git a/library/threading.c b/library/threading.c
index 659aa7e4b..9ee6aea3f 100644
--- a/library/threading.c
+++ b/library/threading.c
@@ -29,37 +29,6 @@
#include "polarssl/threading.h"
-#if defined(POLARSSL_THREADING_DUMMY)
-static int threading_mutex_init_dummy( threading_mutex_t *mutex )
-{
- ((void) mutex );
- return( 0 );
-}
-
-static int threading_mutex_free_dummy( threading_mutex_t *mutex )
-{
- ((void) mutex );
- return( 0 );
-}
-
-static int threading_mutex_lock_dummy( threading_mutex_t *mutex )
-{
- ((void) mutex );
- return( 0 );
-}
-
-static int threading_mutex_unlock_dummy( threading_mutex_t *mutex )
-{
- ((void) mutex );
- return( 0 );
-}
-
-int (*polarssl_mutex_init)( threading_mutex_t * ) = threading_mutex_init_dummy;
-int (*polarssl_mutex_free)( threading_mutex_t * ) = threading_mutex_free_dummy;
-int (*polarssl_mutex_lock)( threading_mutex_t * ) = threading_mutex_lock_dummy;
-int (*polarssl_mutex_unlock)( threading_mutex_t * ) = threading_mutex_unlock_dummy;
-#endif /* POLARSSL_THREADING_DUMMY */
-
#if defined(POLARSSL_THREADING_PTHREAD)
static int threading_mutex_init_pthread( threading_mutex_t *mutex )
{