[tsl] Remove platform:types from mutex dependencies

PiperOrigin-RevId: 656140625
Change-Id: Iaa124ee08a8519b0aeaeaf304c2d80908f854eab
diff --git a/Eigen/ThreadPool b/Eigen/ThreadPool
index b0bbd96..0b1d1a0 100644
--- a/Eigen/ThreadPool
+++ b/Eigen/ThreadPool
@@ -51,19 +51,32 @@
 #include "src/Core/util/Meta.h"
 #include "src/Core/util/MaxSizeVector.h"
 
-// Use TSL synchronization primitives.
-#if !defined(EIGEN_MUTEX) || !defined(EIGEN_MUTEX_LOCK) || !defined(EIGEN_CONDVAR)
-#include "third_party/tensorflow/tsl/platform/mutex.h"
-#endif
+#ifdef EIGEN_USE_CUSTOM_THREAD_POOL
 #ifndef EIGEN_MUTEX
-#define EIGEN_MUTEX ::tsl::mutex
+#define EIGEN_MUTEX std::mutex
 #endif
 #ifndef EIGEN_MUTEX_LOCK
-#define EIGEN_MUTEX_LOCK ::tsl::mutex_lock
+#define EIGEN_MUTEX_LOCK std::unique_lock<std::mutex>
 #endif
 #ifndef EIGEN_CONDVAR
-#define EIGEN_CONDVAR ::tsl::condition_variable
+#define EIGEN_CONDVAR std::condition_variable
 #endif
+#else
+  // Use tensorflow synchronization primitives.
+  #if !defined(EIGEN_MUTEX) || !defined(EIGEN_MUTEX_LOCK) || !defined(EIGEN_CONDVAR)
+    #include "third_party/tensorflow/tsl/platform/mutex.h"
+  #endif
+  #ifndef EIGEN_MUTEX
+    #define EIGEN_MUTEX ::tsl::mutex
+  #endif
+  #ifndef EIGEN_MUTEX_LOCK
+    #define EIGEN_MUTEX_LOCK ::tsl::mutex_lock
+  #endif
+  #ifndef EIGEN_CONDVAR
+    #define EIGEN_CONDVAR ::tsl::condition_variable
+  #endif
+#endif
+
 
 // IWYU pragma: begin_exports
 #include "src/ThreadPool/ThreadLocal.h"